Skip to content

fix(ci): drop the secrets reference from the context-contract job - #53

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/context-job-token
Sep 20, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
fix/context-job-token

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Follow-up to #52, which auto-merged on green before this correction could land in the same PR.

Why

The context-contract job added in #52 referenced the secrets context:

GH_TOKEN: ${{ secrets.HYPATIA_SCAN_PAT || secrets.GITHUB_TOKEN }}

That trips Hypatia's research_extensions: RE001 rule ("job references secrets.* but does not install step-security/harden-runner — review outbound-egress monitoring"), which surfaced as a new code-scanning alert on the pull request (check run Hypatia, app github-advanced-security).

step-security/harden-runner is not in the estate actions allowlist (rhodium-standard-repositories/actions-allowlist/allowed-actions.json, 89 patterns, no step-security/*), so adding it is not an option — it would fail check-allowed-actions.sh and the repository's selected-actions policy, which is the startup-failure class the preflight exists to prevent.

What changed

  • GH_TOKEN: ${{ github.token }} — the same installation token, with no secret context referenced, so RE001 is clear. The job needs read access only.
  • The job now states what it could not read: legacy branch protection needs a credential with Administration: read, which the Actions token cannot have, so the guard reports "branch protection … unreadable … rulesets only" as a notice instead of guessing. It still checks every required context in the repository's rulesets; locally, GH_TOKEN=… bash tools/check-ci-contexts.sh . covers branch protection too.
  • actions/checkout@v4.4.0 → @v7.0.1, the pin the rest of the estate uses, which also clears the Node 20 deprecation warning this job was carrying. actions.lock regenerated with the official extension in the same commit.

Verification

  • check-actions-lock-gate.sh — "Immutable direct and transitive lockfile coverage verified."
  • check-allowed-actions.sh — 6 uses: refs, 0 uncovered by the allowlist.
  • tools/check-ci-contexts.sh . — exit 0; still exit 1 when the caller job is renamed back.

The CI context contract job referenced the secrets context, which trips the
Hypatia scanner's RE001 research extension ("job references secrets.* but does
not install step-security/harden-runner") and surfaced as a new code-scanning
alert on this pull request.

step-security/harden-runner is not in the estate actions allowlist, so adding it
is not an option: it would fail the allowlist preflight and the repository's
selected-actions policy. Use github.token instead. The job needs read access
only, it can read branch rulesets with that token, and the script states plainly
what it could not read (legacy branch protection needs a credential with
Administration: read, which the Actions token cannot have) rather than guessing.

Also move the new workflow to actions/checkout@v7.0.1, the pin the rest of the
estate uses, and record it in actions.lock with the official extension.
@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: e228e086-2d4d-421d-9079-5b1d4ca914a5

📥 Commits

Reviewing files that changed from the base of the PR and between 547ece5 and 116cf36.

⛔ Files ignored due to path filters (1)
  • .github/workflows/actions.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • .github/workflows/ci-contexts.yml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
🔇 Additional comments (1)
.github/workflows/ci-contexts.yml (1)

3-19: LGTM!

Also applies to: 37-37, 41-44, 49-49


📝 Summary

Summary by CodeRabbit

  • Chores
    • Improved CI validation with a clearly named check and documented context requirements.
    • Updated the source-control checkout process and tightened credential handling.
    • Simplified authentication for CI checks by using the workflow’s built-in token.

Walkthrough

The CI workflow now documents its context contract, names the contract job, upgrades checkout, disables persisted credentials, and uses github.token instead of secret contexts.

Changes

CI context contract

Layer / File(s) Summary
Workflow contract and authentication
.github/workflows/ci-contexts.yml
The workflow documents the context contract check and names the job Required contexts are producible. Checkout now uses actions/checkout@v7.0.1 with persist-credentials: false. The check uses github.token instead of secret context.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: metadatastician

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: removing the secrets context reference from the CI context-contract job.
Description check ✅ Passed The description directly explains the CI change, its purpose, constraints, and verification results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit reads each line,
The patch grows clear beneath the moon,
Small changes hop in place,
Tests guard the garden path,
Reviews bloom before the dawn.

Comment @coderabbitai help to get the list of available commands.

@hyperpolymath
hyperpolymath merged commit 2573075 into main Sep 20, 2026
3 of 4 checks passed
@hyperpolymath
hyperpolymath deleted the fix/context-job-token branch September 20, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant