Skip to content

Commit 1178be7

Browse files
ci(check-ci-skip): fix commitMessagesMetadata.forEach is not a function
Primary Changes ---------------- 1. Added condition to commitMessagesMetadata to check if commit message is array or not. Fixes #3614 Signed-off-by: bado <[email protected]>
1 parent deb5073 commit 1178be7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tools/ci-skip-for-maintainers.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,16 @@ const main = async () => {
3333
pullReqUrl + "/commits",
3434
);
3535

36-
commitMessagesMetadata.forEach((commitMessageMetadata) => {
37-
// get commit message body
38-
commitMessageList.push(commitMessageMetadata["commit"]["message"]);
39-
});
36+
if (Array.isArray(commitMessagesMetadata)) {
37+
commitMessagesMetadata.forEach((commitMessageMetadata) => {
38+
// get commit message body
39+
commitMessageList.push(commitMessageMetadata["commit"]["message"]);
40+
});
41+
} else {
42+
console.error(
43+
"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.",
44+
);
45+
}
4046

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

0 commit comments

Comments
 (0)