Skip to content

Commit 6484eda

Browse files
committed
CI/GnuComment: add safeguards
1 parent 36db2e6 commit 6484eda

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/GnuComment.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ jobs:
5050
github-token: ${{ secrets.GITHUB_TOKEN }}
5151
script: |
5252
const fs = require('fs');
53+
if (!fs.existsSync('./NR') || !fs.existsSync('./result.txt')) {
54+
core.info("No GNU comment payload to post.");
55+
return;
56+
}
5357
const issue_number = Number(fs.readFileSync('./NR'));
58+
if (!issue_number) {
59+
core.info('No PR number; skipping.');
60+
return;
61+
}
5462
const content = fs.readFileSync('./result.txt').toString();
5563
5664
const marker = '<!-- gnu-comment-bot -->';

0 commit comments

Comments
 (0)