Skip to content

Commit 703dd77

Browse files
ci: drop secrets: inherit where unused; explicit mirror secrets; scorecard actions: read (#348)
## Summary Three workflow callers here forward every repository secret with `secrets: inherit` to reusable workflows that do not use them, and the scorecard caller is missing a permission its callee requires. Both were raised by CodeRabbit on #344 (already merged); I checked each claim against the callee at the pinned commit before acting. ## Changes - `secret-scanner.yml`: remove `secrets: inherit`. `secret-scanner-reusable.yml@75bd5994` declares no `workflow_call` secrets and reads none (its gitleaks is a pinned local binary; the `GITHUB_TOKEN` it runs under comes from `permissions:`). - `scorecard.yml`: remove `secrets: inherit` (`scorecard-reusable.yml@75bd5994` declares none and reads none), and add `actions: read` to the job-level `permissions:` block. A job-level block replaces the workflow-level one, so `actions: read` was being dropped; the callee's job requests it, and GitHub refuses a called job that asks for more than its caller grants. This is the same startup failure found in choreographic-types #31, here only on the scheduled and `branch_protection_rule` triggers. - `mirror.yml`: replace `secrets: inherit` with an explicit map of the seven secrets `mirror-reusable.yml@75bd5994` declares (all optional), as affinescript-libraries already does. Behaviour is unchanged; future secrets are no longer shared implicitly. ## Testing - All three workflow files parse; `check-lock-sync.sh` still passes (no `uses:` change). - The scorecard fix can only be proven by a scheduled or manual Scorecard run; I have not run one. A branch-run cannot exercise it. - The mirror map passes secrets by name; a repo that has none of the seven set behaves as before. --- _Generated by [Claude Code](https://claude.ai/code/session_01MF5GeeBBDF6sUzr6pZTjWV)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8d7e882 commit 703dd77

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎.github/workflows/mirror.yml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@ permissions:
1616
jobs:
1717
mirror:
1818
uses: hyperpolymath/standards/.github/workflows/mirror-reusable.yml@75bd5994470661a099df562d6d5ad2fe744dbd66
19-
secrets: inherit
19+
# Explicit secrets map, not `secrets: inherit` (Hypatia WH008): the callee
20+
# (standards@75bd5994) declares exactly these seven, all optional.
21+
secrets:
22+
GITLAB_SSH_KEY: ${{ secrets.GITLAB_SSH_KEY }}
23+
BITBUCKET_SSH_KEY: ${{ secrets.BITBUCKET_SSH_KEY }}
24+
CODEBERG_SSH_KEY: ${{ secrets.CODEBERG_SSH_KEY }}
25+
SOURCEHUT_SSH_KEY: ${{ secrets.SOURCEHUT_SSH_KEY }}
26+
DISROOT_SSH_KEY: ${{ secrets.DISROOT_SSH_KEY }}
27+
GITEA_SSH_KEY: ${{ secrets.GITEA_SSH_KEY }}
28+
RADICLE_KEY: ${{ secrets.RADICLE_KEY }}

‎.github/workflows/scorecard.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ jobs:
1919
# (its header documents: the caller MUST grant security-events:write
2020
# + id-token:write; contents:read lets it read the repo). Closes the
2121
# Hypatia `scorecard_wrapper_missing_job_permissions` finding.
22+
# actions: read is repeated here: this job-level block replaces the
23+
# workflow-level one, and the callee's job requests actions: read.
24+
# The callee declares no secrets, so no `secrets:` line.
2225
permissions:
26+
actions: read
2327
contents: read
2428
security-events: write
2529
id-token: write
2630
uses: hyperpolymath/standards/.github/workflows/scorecard-reusable.yml@75bd5994470661a099df562d6d5ad2fe744dbd66
27-
secrets: inherit

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ jobs:
2424
pull-requests: write
2525
actions: read
2626
uses: hyperpolymath/standards/.github/workflows/secret-scanner-reusable.yml@75bd5994470661a099df562d6d5ad2fe744dbd66
27-
secrets: inherit

0 commit comments

Comments
 (0)