Skip to content

Commit

Permalink
Escaping checklist items for regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
sebryu committed Sep 26, 2023
1 parent fe69583 commit 5dc3ce4
Show file tree
Hide file tree
Showing 3 changed files with 17,223 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/actions/javascript/authorChecklist/authorChecklist.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const core = require('@actions/core');
const github = require('@actions/github');
const https = require('https');
const _ = require('underscore');
const _ = require('lodash');
const GithubUtils = require('../../../libs/GithubUtils');
const CONST = require('../../../libs/CONST');
const newComponentCategory = require('./newComponentCategory');
Expand Down Expand Up @@ -122,7 +122,7 @@ async function generateDynamicChecksAndCheckForCompletion() {
let isPassing = true;
for (const check of checks) {
// Check if it's already in the PR body, capturing the whether or not it's already checked
const regex = new RegExp(`- \\[([ x])] ${check}\n`);
const regex = new RegExp(`- \\[([ x])] ${_.escapeRegExp(check)}\n`);
const match = regex.exec(checklist);
if (!match) {
// Add it to the PR body
Expand Down
Loading

0 comments on commit 5dc3ce4

Please sign in to comment.