Skip to content

Commit

Permalink
ci(check-ci-skip): fix commitMessagesMetadata.forEach is not a function
Browse files Browse the repository at this point in the history
Primary Changes
----------------
1. Added condition to commitMessagesMetadata
to check if commit message is array or not.

Fixes hyperledger-cacti#3614

Signed-off-by: bado <[email protected]>
  • Loading branch information
zondervancalvez committed Nov 5, 2024
1 parent deb5073 commit 1178be7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tools/ci-skip-for-maintainers.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ const main = async () => {
pullReqUrl + "/commits",
);

commitMessagesMetadata.forEach((commitMessageMetadata) => {
// get commit message body
commitMessageList.push(commitMessageMetadata["commit"]["message"]);
});
if (Array.isArray(commitMessagesMetadata)) {
commitMessagesMetadata.forEach((commitMessageMetadata) => {
// get commit message body
commitMessageList.push(commitMessageMetadata["commit"]["message"]);
});
} else {
console.error(
"Fetching data from github API failed. This is most likely due to an intermittent issue from Github end or the api being rate limited (one hour cooldown). Please retry running the failed check after an hour.",
);
}

// Check if skip-ci is found in commit message
const checkSkipCI = () => {
Expand Down

0 comments on commit 1178be7

Please sign in to comment.