Skip to content

Commit

Permalink
Rewrote _.each to regular for loop for better async handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sebryu committed Sep 26, 2023
1 parent 1697bb3 commit 92ef235
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/actions/javascript/authorChecklist/authorChecklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ async function getChecklistCategoriesForPullRequest() {
per_page: 100,
});

_.each(CHECKLIST_CATEGORIES, async ({ detectFunction, items }) => {
for (const category of CHECKLIST_CATEGORIES) {
const { detectFunction, items } = category;
const categoryDetected = await detectFunction(changedFiles);
if (!categoryDetected) {
return;
}
categories.push(items);
});
};

// TODO add more if statements to look for other dynamic checklist categories

Expand Down
5 changes: 3 additions & 2 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ async function getChecklistCategoriesForPullRequest() {
per_page: 100,
});

_.each(CHECKLIST_CATEGORIES, async ({ detectFunction, items }) => {
for (const category of CHECKLIST_CATEGORIES) {
const { detectFunction, items } = category;
const categoryDetected = await detectFunction(changedFiles);
if (!categoryDetected) {
return;
}
categories.push(items);
});
};

// TODO add more if statements to look for other dynamic checklist categories

Expand Down

0 comments on commit 92ef235

Please sign in to comment.