ci: pin actions to commit SHAs and the publish npm CLI to an exact version - #95
Merged
Merged
Conversation
…rsion The release workflow ran `npx -y npm@latest publish` with `id-token: write` in scope, so whatever `latest` pointed to at publish time executed with the OIDC publish credential live. Every third-party action was also referenced by a mutable major tag that upstream can re-point without any change in this repo, including release-please-action, which runs in that same credential-bearing workflow. - Pin all eight third-party actions to the full commit SHA their major tag currently resolves to, with the release version in a trailing comment so Dependabot's github-actions updates keep bumping them. - Pin the publish CLI to npm@12.0.2, the version the last three releases actually published with (recorded as _npmVersion on the registry), so the pipeline's behaviour is unchanged. Dependabot does not track this reference; a comment in the workflow says to bump it by hand. No runtime or package change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RGojvqCf6LBDRR7rms31CR
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
The release workflow ran
npx -y npm@latest publishwithid-token: writein scope, so whateverlatestpointed to at publish time executed with the OIDC publish credential live. Every third-party action was also referenced by a mutable major tag that upstream can re-point without any change in this repo, includinggoogleapis/release-please-action, which runs in that same credential-bearing workflow. This PR pins both so the publish pipeline only ever runs code that was explicitly chosen here.Type of change
src/slack-block-kit.schema.json)Changes
SHA-pin all eight third-party actions to the full commit their major tag resolves to today, with the release version in a trailing
# vX.Y.Zcomment. The existing Dependabotgithub-actionsconfig understands this format and will keep bumping the SHA and the comment together.actions/checkout@v73d3c42e5…(v7.0.1)actions/setup-node@v449933ea5…(v4.4.0)pnpm/action-setup@v4b906affc…(v4.3.0)codecov/codecov-action@v7fb8b3582…(v7.0.0)oven-sh/setup-bun@v20c5077e5…(v2.2.0)denoland/setup-deno@v222d081ff…(v2.0.5)dependabot/fetch-metadata@v325dd0e34…(v3.1.0)googleapis/release-please-action@v545996ed1…(v5.0.0)Pin the publish CLI to
npm@12.0.2. This is the version the last three releases (0.1.14 through 0.1.16) actually published with, per the_npmVersionthe registry recorded for each, so pipeline behaviour is unchanged. The runner's Node 22.23.2 satisfies its^22.22.2engine range. The version lives in one shell variable so a future bump is a single edit.Workflow comment explaining why the CLI is pinned and that Dependabot does not track
npx npm@…references, so it has to be bumped by hand and kept at or above 11.5.1 (the Trusted Publisher minimum).Two things reviewers may want to double-check:
denoland/setup-deno@v2was a branch, not a tag. It is pinned to the branch head, which is thev2.0.5release commit.pnpm/action-setup@v4resolves tov4.3.0, notv4.4.0: upstream never moved the floatingv4tag. Pinning to whatv4actually resolves to keeps behaviour identical; Dependabot can propose the bump separately.Testing
pnpm testpassespnpm typecheckpassespnpm lintpassespnpm validate-schemapasses (if the schema changed)test/covering the changeNot run locally: no TypeScript changed. CI on this PR runs every pinned action except
release-please-action(checkout, setup-node, pnpm, bun, deno, codecov), which is the real test for the pins. All workflow files parse as YAML and the publish script passesbash -n.release-please-actionand the publish step only run onmain, so the first release after merge is the end-to-end check for those two.Schema changes
N/A
Checklist
ci:does not trigger a release.README.md(N/A, no API change)🤖 Generated with Claude Code
https://claude.ai/code/session_01RGojvqCf6LBDRR7rms31CR
Generated by Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.