CI: converge the secret scan on the shared hseshadr/ci brick - #24
Open
hseshadr wants to merge 2 commits into
Open
CI: converge the secret scan on the shared hseshadr/ci brick#24hseshadr wants to merge 2 commits into
hseshadr wants to merge 2 commits into
Conversation
The inlined gitleaks job was a hand-maintained duplicate of the reusable workflow in hseshadr/ci. Replace it with a SHA-pinned call to secret-scan.yml@ci-v3.2.1 so there is one maintained copy of this control. The brick is not just a copy — it fixes two things the inlined job was missing: `persist-credentials: false` on checkout, and the `pull-requests: read` scope gitleaks-action needs to list a PR's commits over the API. The reported check name changes from `gitleaks` to `Secret scan / gitleaks`. Branch protection on main must be updated before this merges. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mNrrQ5dDEr6ZwLntu7XtF
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019mNrrQ5dDEr6ZwLntu7XtF
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.
Claim touched
"Every commit in this repo's full history is scanned for secrets on every PR."
This PR does not change whether that claim holds — it changes where the one
maintained copy of the control lives. The inlined
gitleaksjob was ahand-maintained duplicate of the reusable workflow in
hseshadr/ci, and it hadalready drifted from it.
What changed
.github/workflows/ci.ymlonly. The inlined job is replaced by a SHA-pinned callto the shared brick:
The SHA is the dereferenced commit of the annotated tag
ci-v3.2.1(
refs/tags/ci-v3.2.1-> tag objectedbd737d-> commit605e51cb), verifiedagainst the GitHub API, not copied from a branch head. The comment names the
exact patch version, never a floating
# ci-v3.The brick strictly strengthens the control. It carries two things the inlined
copy was missing:
fetch-depth: 0(full history)persist-credentials: falsepull-requests: readpull-requests: readis load-bearing, not cosmetic:gitleaks-actionlists aPR's commits over the API on
pull_requestevents, and without that scope it403s "Resource not accessible by integration" before it scans anything. The
caller job declares the scope explicitly because the workflow-level
permissions: contents: readdoes not grant it.The reported check name changes. A reusable-workflow call reports as
<caller job name> / <callee job id>. The caller job is namedSecret scanandthe callee job id in the brick is
gitleaks, so:gitleaksSecret scan / gitleaksBranch protection on
maincurrently requires exactly:It must become:
…and that change must land BEFORE this PR merges. If it doesn't, the required
gitleakscontext stops being reported the moment this lands onmain, andevery subsequent PR blocks forever waiting on a check that no longer exists.
This is an owner action. I have not touched branch protection and will not.
Knock-on: PR #23 will need a rebase
Open PR #23 (
feat/ordinal-agreement-and-confusion-counts) is based onpre-conversion
main, so its head still produces the old baregitleakscontext. Once protection swaps to
Secret scan / gitleaks, #23 must be rebasedonto
mainto produce the new context — otherwise it will sit blocked on arequired check its branch cannot emit.
Evidence
git/ref/tags/ci-v3.2.1-> tagedbd737d…->git/tags/edbd737d-> commit605e51cb…gitleakssecret-scan.ymlat that exact SHAuv run poe gate— 193 passed, 100% coverage (90% floor), 4.3sgrep -rn -i gitleaksoutside.github/returns nothingThe pinning guard still holds, unmodified
tests/test_workflow_security.pyasserts everyuses:in this repo — explicitlyincluding first-party
hseshadr/cireusable workflows — resolves to a full40-hex commit SHA. Its
PINNEDregex already accepts theowner/repo/path/to/workflow.yml@<sha>form, so the new call is covered by theexisting guard with no test change. That is the point: the guard was written
against the property (immutable ref), not the shape of any one job, so converging
onto the brick did not require weakening it.
No non-workflow file needed changing.