Skip to content

Commit 7f7456c

Browse files
hyperpolymathclaude
andcommitted
fix(ci): add missing actions:read perm to scan reusables
The hypatia-scan + secret-scanner reusables consume third-party actions (codeql-action/upload-sarif and gitleaks-action) that need permissions the reusables didn't grant. Reusable workflow permission blocks OVERRIDE the caller's, so adding perms at the wrapper is a no-op — the fix must live here at source. hypatia-scan-reusable.yml — workflow-level: + actions: read Lets `codeql-action/upload-sarif` call GET /actions/runs/{id} to attach the SARIF blob. Without it, the SARIF upload fails with "Resource not accessible by integration" AFTER the scan + conversion both succeed. Symptom reproduced across .git-private-farm and other consumers. secret-scanner-reusable.yml — gitleaks job-level (NOT workflow-level, keeps trufflehog / rust-secrets / shell-secrets at minimum perms): permissions: contents: read pull-requests: write actions: read gitleaks-action's `ScanPullRequest` posts a PR summary comment (needs pull-requests: write) and queries PR-files / workflow-run metadata (needs actions: read). Without both, the action throws RequestError [HttpError]: Resource not accessible by integration AFTER the gitleaks scan itself succeeds. Verifying logs from .git-private-farm#69 / job 79144809024 (gitleaks) + job 79144809505 (hypatia SARIF) both show post-scan permission errors that this PR resolves. Net new perm grants are MINIMAL: `actions: read` is read-only and matches GitHub's documented requirement for these specific actions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f2b9d5e commit 7f7456c

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/hypatia-scan-reusable.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,17 @@ permissions:
8181
# "Resource not accessible by integration" and (absent continue-on-error)
8282
# hard-fails the scan — exactly what the gate-decoupling design forbids.
8383
pull-requests: write
84+
# actions: read lets `codeql-action/upload-sarif` call
85+
# GET /repos/{owner}/{repo}/actions/runs/{run_id} to attach the SARIF
86+
# blob to the workflow run. Without it the upload step fails with
87+
# "Resource not accessible by integration" AFTER the scan + SARIF
88+
# conversion both succeed — symptoms observed across .git-private-farm
89+
# and other estate consumers since the SARIF upload was wired in.
90+
# Reusable workflow permission blocks OVERRIDE the caller's permission
91+
# block, so this MUST live here at source rather than at every
92+
# wrapper — adding it only at the wrapper is a no-op.
93+
# See .git-private-farm#69 for the reproducing logs.
94+
actions: read
8495

8596
jobs:
8697
scan:

.github/workflows/secret-scanner-reusable.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ jobs:
7777

7878
gitleaks:
7979
runs-on: ${{ inputs.runs-on }}
80+
# Job-level permissions (narrower than granting these workflow-wide).
81+
# The other jobs (trufflehog / rust-secrets / shell-secrets) only need
82+
# `contents: read`, which they get from the workflow-level block.
83+
permissions:
84+
contents: read
85+
# gitleaks-action's `ScanPullRequest` posts a summary comment via
86+
# the GitHub Issues/PR API. Without `pull-requests: write` it fails
87+
# with "Resource not accessible by integration" AFTER the gitleaks
88+
# scan itself succeeds. Reusable-workflow permission blocks
89+
# OVERRIDE the caller's, so this MUST live here at source.
90+
# See .git-private-farm#69 for the reproducing logs.
91+
pull-requests: write
92+
# Additional API calls inside `ScanPullRequest` (workflow-run
93+
# metadata, PR-files endpoint) require `actions: read`.
94+
actions: read
8095
steps:
8196
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8297
with:

0 commit comments

Comments
 (0)