ci(scorecard): add job-level permissions for reusable workflow#47
Merged
Conversation
Reusable-workflow permission inheritance caps called-workflow permissions by the caller's block. Without job-level overrides, ossf/scorecard-action cannot upload SARIF — runs silently startup_failure. Refs hyperpolymath/standards#282 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
that referenced
this pull request
Jun 4, 2026
…gate instant-sync (#53) ## Summary Follow-up to #52. After the reusable re-pins landed, I verified `main`'s post-merge CI and found **Hypatia is now green** (re-pin worked) but **Scorecards still `startup_failure`** — proving its cause was *not* the stale SHA. Root-caused and fixed here, plus the one genuinely-actionable Hypatia HIGH. ## Scorecard `startup_failure` — real root cause The `scorecard-reusable.yml` declares top-level `permissions: contents: read`. But this repo's wrapper sets **job-level** `permissions: { security-events: write, id-token: write }` (added in #47), and a job-level permissions block sets every unlisted permission to `none` — so `contents` became `none`. A reusable workflow that requests a permission its caller didn't grant **fails at startup** (0 jobs), which is exactly the symptom — and it persisted across the re-pin (unlike Hypatia, whose wrapper grants `contents: read` at workflow level). **Fix:** add `contents: read` to the `analysis` job's permissions (verified against the reusable's declared `permissions:` at `861b5e9`). ## instant-sync — presence gate Per Hypatia's `secret_action_without_presence_gate` (HIGH), the `repository-dispatch` step is now gated on token presence (job `env` + `if: ${{ env.FARM_DISPATCH_TOKEN != '' }}`), so absent-token contexts skip cleanly.⚠️ This does **not** make Instant Sync green by itself: the configured `FARM_DISPATCH_TOKEN` returns `Bad credentials` and **must be rotated by the maintainer** — no in-repo change can mint a valid credential. ## Still needs a maintainer decision (surfaced, not touched — ambiguous/destructive) - **6 submodule gitlinks with no `.gitmodules`** (`fs`, `obli-fs`, `transpiler`, `ssg`, `riscv-dev-kit`, `obli-riscv-dev-kit`) — all empty, pointing at commits with no URL. Either restore a `.gitmodules` (if real submodules) or `git rm --cached` them (if accidental). Needs your intent. - **Stale remote branches** (`GS007`): e.g. `cicd/codeql-cron-monthly`, `claude/codeql-actions-scan`, `claude/proof-debt-ledger`. Branch deletion is destructive — your call. - **`CSA001` structural-drift** alerts on `.machine_readable/{PLAYBOOK,NEUROSYM,AGENTIC}.scm` (stale prior-run code-scanning alerts) — schema work, needs context. - The other Hypatia findings are advisory; the 5 remaining `missing_timeout_minutes` flags are **false positives** (reusable-caller jobs cannot carry `timeout-minutes`). 🤖 Draft — opened for review. https://claude.ai/code/session_01GJatEm2TVFSTBEkKXmserJ --- _Generated by [Claude Code](https://claude.ai/code/session_01GJatEm2TVFSTBEkKXmserJ)_ Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
permissions: { security-events: write, id-token: write }tojobs.analysisso the called scorecard reusable can upload SARIF.permissions: read-allcaps the reusable andossf/scorecard-actionsilentlystartup_failures.Refs hyperpolymath/standards#282
Test plan
🤖 Generated with Claude Code