Repository navigation
ci: lock the actions in actions.lock, drop the write-all defaults and scope the benchmark secrets - #1975
ci: lock the actions in actions.lock, drop the write-all defaults and scope the benchmark secrets#1975thomasboni wants to merge 1 commit into
Conversation
| profile: pr-compare | ||
| pr_number: ${{ github.event.issue.number || inputs.pr_number }} | ||
| secrets: inherit | ||
| secrets: |
There was a problem hiding this comment.
why not inherit the secrets here?
There was a problem hiding this comment.
secrets: inherit forwards every secret into the workflow, while the callee here only declares WORKFLOW_AUTH_PUBLIC_APP_ID and WORKFLOW_AUTH_PUBLIC_PRIVATE_KEY, so everything beyond those two is exposure with no benefit.
And this particular callee lives in a different repo (ClickHouse/integrations-shared-workflows) and is referenced on @main, meaning any future change to that workflow immediately runs here with whatever secrets we hand it.
Passing them explicitly caps what a change on that side can ever reach, and doubles as documentation of what the workflow actually needs. If the shared workflow grows a new secret later, the failure is loud (a missing-secret error) instead of a silent broadening of access.
|
|
||
| - name: golangci-lint | ||
| uses: golangci/golangci-lint-action@v9 | ||
| uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 |
There was a problem hiding this comment.
I'm not super comfortable with git commit hash here. Can't we just do @v9.3.0 here? (similar in other places?)
There was a problem hiding this comment.
In most cases the git commit hash is the only way to be sure the action you are using is immutable. It's highly recommended when the action comes from an external source that could be compromised and run malicious code in your pipeline (which has access to secrets, code, envs, etc.). That's the route the tj-actions/changed-files compromise took.
But in this specific case with golangci/golangci-lint-action you are right to prefer @v9.3.0, because the repo uses GitHub's immutable releases. The v9.3.0 release is marked immutable, meaning the tag can never be repointed or deleted. So @v9.3.0 gives the same guarantee as the SHA, and I'm going to switch that one back. Same for codeql-action, its releases are immutable too.
The others are different:
lychee-action@v2.9.0: mutable tag from a third-party org. I'd keep the SHA here, but if you prefer the tag for readability I can revert it.claude-code-action@v1.0.190: mutable tag, maintained by Anthropic. Larger vendor, but still a third party with a repointable tag. Your call, tell me which way you want it.actions/checkout@v5.1.0: mutable tag, maintained by GitHub itself. If you trust GitHub the tag is reasonable, I will revert to@v5.1.0(tell me if not).
🤖 Claude reviewRe-review of the CI hardening PR. The previous round's Verified this round:
Key concern: Blind spots:
Verdict: General findings
Inline comments are attached to the relevant lines. This summary updates in place on re-review. |
|
Hi @kavirajk
|
7a7056c to
c73ff30
Compare
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: |
|
|
||
| - name: Review PR with Claude (produce findings JSON) | ||
| uses: anthropics/claude-code-action@v1 | ||
| uses: anthropics/claude-code-action@5ef2e550a465a721f4f45e4a7d3c340c873e1dcc # v1.0.190 |
There was a problem hiding this comment.
I'm failing to understand the exactly rationale for SHA based versioning for claude-code-action and lyche from the PR description.
Can you help me understand @thomasboni ? This is my only concern with the PR. After than we can merge
… scope the benchmark secrets .github/workflows/actions.lock, generated with gh actions-lock, records the commit, owner id and repository id of every action the workflows run. The runner executes the locked commit whatever the ref says, so a moved tag cannot change what runs, and the refs in the files stay readable versions: each floating ref moves to the exact release it resolves to today. This replaces the commit hashes the earlier revision of this change wrote into the files, which were the only way to get the same guarantee before the lockfile existed. CodeQL moves off its v1 tag, last moved in January 2023, to the current v4 release, and the two actions/checkout@main references move to a release. run-tests.yml, run-tests-head.yml and release.yml defaulted to write-all. None of them writes with GITHUB_TOKEN: the test workflows check out and run tests, release.yml mints a GitHub App token for its checkout, release call and push. All three declare contents: read. stresshouse-benchmark-compare.yml forwarded every repository secret to the shared benchmark workflow with secrets: inherit. That workflow declares two, WORKFLOW_AUTH_PUBLIC_APP_ID and WORKFLOW_AUTH_PUBLIC_PRIVATE_KEY, which are now passed explicitly.
197d594 to
2870c08
Compare
|
@kavirajk sorry for the very long silence, I missed the notification on your question. On the commit hashes: until recently, writing the commit SHA in the GitHub shipped a better mechanism in October, the workflow dependency lockfile. I rebuilt the PR on it: The branch is rebased on main and squashed to one commit. Your rework of |
AI review gate — Waiting for AI review
What to do:
The gate stopped waiting after 15 minutes. The bot re-runs this gate automatically when you mark the pull request ready or the review lands; or comment |
Summary
Three changes, one commit, rebased on
main..github/workflows/actions.lock, GitHub's workflow dependency lockfile, generated withgh actions-lock, records the commit of every action, and the runner executes that commit whatever the tag says, so a moved tag cannot change what runs. The refs become exact releases, readable, no hash in the files. CodeQL moves fromv1tov4, the twocheckout@mainrefs to a release.run-tests.yml,run-tests-head.ymlandrelease.ymldefaulted towrite-all. None writes withGITHUB_TOKEN,release.ymluses its App token for checkout, release and push. All three declarecontents: read.stresshouse-benchmark-compare.ymlforwarded every secret withsecrets: inherit. The shared workflow declares two, now passed explicitly.Why: a moved tag on any action in
release.ymlruns with the App token that publishes releases, the way tj-actions/changed-files leaked secrets in March 2025 (CVE-2025-30066).Left alone: the
integrations-shared-workflows@maincalls, your own, a lockfile cannot cover reusable workflows. Allowed-actions patterns likeowner/action@v1now needowner/action@*.Found and fixed with Plumber (D 48/100 before, C 50/100 after, the rest is the
pull_request_targetdesign and the shared workflows), reviewed and submitted by me.Checklist
Workflow files only, no test or documentation impact.