Skip to content

Commit 3bfbd70

Browse files
ralyodioclaude
andcommitted
ci(vu1nz-scan): don't fail the scan when the PR comment can't be posted
Dependabot PRs run with a read-only GITHUB_TOKEN, and GitHub was returning 503 (the HTML "Unicorn" page) for the comment write; the step's catch only handled 403 and re-threw everything else, failing the whole scan even though the security scan itself passed. - skip the comment step for github.actor == 'dependabot[bot]' - continue-on-error: true - warn-and-continue on any status instead of only 403 Mirrors sh1pt pack vu1nz-scan@1.0.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 24269b6 commit 3bfbd70

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/vu1nz-scan.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ jobs:
166166
fi
167167
168168
- name: Comment on PR
169-
if: always() && github.event.pull_request.head.repo.full_name == github.repository
169+
# Best-effort only. Skip for Dependabot (read-only token can't comment)
170+
# and never fail the job if posting the comment errors — the scan's
171+
# pass/fail is decided by the "Build PR comment" step, and findings are
172+
# always written to the job summary.
173+
if: always() && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
174+
continue-on-error: true
170175
uses: actions/github-script@v9
171176
with:
172177
script: |
@@ -206,9 +211,9 @@ jobs:
206211
});
207212
}
208213
} catch (err) {
209-
if (err.status === 403) {
210-
core.warning(`Cannot post PR comment (read-only token): ${err.message}. Findings are in the job summary.`);
211-
} else {
212-
throw err;
213-
}
214+
// Posting the comment is best-effort. Read-only tokens return 403
215+
// and transient GitHub outages return 503 (the "Unicorn" HTML
216+
// page); neither should fail the scan. Findings are in the job
217+
// summary regardless.
218+
core.warning(`Could not post PR comment (status ${err.status ?? 'unknown'}): ${err.message}. Findings are in the job summary.`);
214219
}

0 commit comments

Comments
 (0)