fix(ci): don't fail supply chain scan when PR comment can't be posted on fork PRs (#6681)
The GITHUB_TOKEN for fork PRs is read-only — gh pr comment fails with 'Resource not accessible by integration'. This caused the supply chain scan to show a red X on every fork PR even when no findings were detected. The scan itself still runs and the 'Fail on critical findings' step still exits 1 on real issues. Only the comment posting is gracefully skipped for fork PRs. Closes #6679 Co-authored-by: SHL0MS <SHL0MS@users.noreply.github.com>
This commit is contained in:
2
.github/workflows/supply-chain-audit.yml
vendored
2
.github/workflows/supply-chain-audit.yml
vendored
@@ -183,7 +183,7 @@ jobs:
|
||||
---
|
||||
*Automated scan triggered by [supply-chain-audit](/.github/workflows/supply-chain-audit.yml). If this is a false positive, a maintainer can approve after manual review.*"
|
||||
|
||||
gh pr comment "${{ github.event.pull_request.number }}" --body "$BODY"
|
||||
gh pr comment "${{ github.event.pull_request.number }}" --body "$BODY" || echo "::warning::Could not post PR comment (expected for fork PRs — GITHUB_TOKEN is read-only)"
|
||||
|
||||
- name: Fail on critical findings
|
||||
if: steps.scan.outputs.critical == 'true'
|
||||
|
||||
Reference in New Issue
Block a user