Skip to content

Commit

Permalink
Fixed calling set.length instead of set.size
Browse files Browse the repository at this point in the history
  • Loading branch information
sebryu committed Sep 26, 2023
1 parent 5dc3ce4 commit aedc1e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/actions/javascript/authorChecklist/authorChecklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit aedc1e8

Please sign in to comment.