From aedc1e8d4f60c0a7ebd2f041ddfd01336294eaaa Mon Sep 17 00:00:00 2001 From: Sebastian Szewczyk Date: Tue, 26 Sep 2023 15:13:37 +0200 Subject: [PATCH] Fixed calling set.length instead of set.size --- .../actions/javascript/authorChecklist/authorChecklist.js | 6 +++--- .github/actions/javascript/authorChecklist/index.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/actions/javascript/authorChecklist/authorChecklist.js b/.github/actions/javascript/authorChecklist/authorChecklist.js index 93a9f9b052f6..3083c852bd0c 100644 --- a/.github/actions/javascript/authorChecklist/authorChecklist.js +++ b/.github/actions/javascript/authorChecklist/authorChecklist.js @@ -135,11 +135,11 @@ async function generateDynamicChecksAndCheckForCompletion() { } } } - const allChecks = _.flatten(CHECKLIST_CATEGORIES.values); + const allChecks = _.flatten(_.values(CHECKLIST_CATEGORIES)); for (const check of allChecks) { if (!checks.has(check)) { // Check if some dynamic check has been added with previous commit, but the check is not relevant anymore - const regex = new RegExp(`- \\[([ x])] ${check}\n`); + const regex = new RegExp(`- \\[([ x])] ${_.escapeRegExp(check)}\n`); const match = regex.exec(checklist); if (match) { // Remove it from the PR body @@ -152,7 +152,7 @@ async function generateDynamicChecksAndCheckForCompletion() { const newBody = contentBeforeChecklist + checklistStartsWith + checklist + checklistEndsWith + contentAfterChecklist; // Update the PR body - if (checks.length > 0) { + if (checks.size > 0) { await GithubUtils.octokit.pulls.update({ owner: CONST.GITHUB_OWNER, repo: CONST.APP_REPO, diff --git a/.github/actions/javascript/authorChecklist/index.js b/.github/actions/javascript/authorChecklist/index.js index 6bde6e9ca982..e71c2997b6c1 100644 --- a/.github/actions/javascript/authorChecklist/index.js +++ b/.github/actions/javascript/authorChecklist/index.js @@ -145,11 +145,11 @@ async function generateDynamicChecksAndCheckForCompletion() { } } } - const allChecks = _.flatten(CHECKLIST_CATEGORIES.values); + const allChecks = _.flatten(_.values(CHECKLIST_CATEGORIES)); for (const check of allChecks) { if (!checks.has(check)) { // Check if some dynamic check has been added with previous commit, but the check is not relevant anymore - const regex = new RegExp(`- \\[([ x])] ${check}\n`); + const regex = new RegExp(`- \\[([ x])] ${_.escapeRegExp(check)}\n`); const match = regex.exec(checklist); if (match) { // Remove it from the PR body @@ -162,7 +162,7 @@ async function generateDynamicChecksAndCheckForCompletion() { const newBody = contentBeforeChecklist + checklistStartsWith + checklist + checklistEndsWith + contentAfterChecklist; // Update the PR body - if (checks.length > 0) { + if (checks.size > 0) { await GithubUtils.octokit.pulls.update({ owner: CONST.GITHUB_OWNER, repo: CONST.APP_REPO,