Skip to content

Commit 52046ea

Browse files
tanush5800claude
andcommitted
fix(ci): hypatia-scan PR-comment must not gate the scan
Canonical adoption got the scanner running (Clone/Build/Run all ✓) but the 'Comment on PR with findings' step hard-failed: github-script@v7 with the default GITHUB_TOKEN got 'Resource not accessible by integration' — the permissions block had no pull-requests: write and the step had no continue-on-error, despite the template's own design note that this step 'must NEVER hard-fail the scan' (hypatia#213). Two-part at-source fix (latent canonical-template gap): - permissions: add pull-requests: write so the advisory comment posts - Comment step: continue-on-error: true so a token/API hiccup or a fork PR (read-only token) skips the comment, never the check Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c2e139a commit 52046ea

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/hypatia-scan.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ permissions:
2525
# the rule silently returns no findings.
2626
# See 007-lang/audits/audit-dependabot-automation-gap-2026-04-17.md.
2727
security-events: read
28+
# pull-requests: write lets the advisory "Comment on PR with findings"
29+
# step post its summary. Without it the built-in GITHUB_TOKEN gets
30+
# "Resource not accessible by integration" and (absent continue-on-error)
31+
# hard-fails the scan — exactly what the gate-decoupling design forbids.
32+
pull-requests: write
2833

2934
jobs:
3035
scan:
@@ -211,6 +216,11 @@ jobs:
211216
212217
- name: Comment on PR with findings
213218
if: github.event_name == 'pull_request' && steps.scan.outputs.findings_count > 0
219+
# Advisory only — posting findings as a PR comment must never gate
220+
# the scan (hypatia#213 gate decoupling). Belt-and-braces alongside
221+
# the pull-requests: write permission above: a token/API hiccup or
222+
# a fork PR (read-only token) skips the comment, not the check.
223+
continue-on-error: true
214224
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v7
215225
with:
216226
script: |

0 commit comments

Comments
 (0)