fix(release): pin npm publish checkout to release ref#21
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the release → npm publish workflow handoff to ensure npm artifacts are built from the same commit as the GitHub Release, reducing supply-chain/provenance risk from publishing off a mutable ref.
Changes:
- Update
release.ymlto dispatchnpm-publish.ymlusing the release tag ref (instead ofmain) and pass the release commit SHA. - Add an optional
release_shainput tonpm-publish.ymland pinactions/checkoutto${{ inputs.release_sha || inputs.version }}for manual dispatches.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/release.yml | Dispatch npm-publish.yml from the release ref and pass release_sha for commit pinning. |
| .github/workflows/npm-publish.yml | Add release_sha input and use it to pin checkout for workflow_dispatch runs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --repo "${{ github.repository }}" \ | ||
| --ref main \ | ||
| -f version="${{ inputs.version }}" | ||
| --ref "${{ inputs.version }}" \ |
| with: | ||
| ref: ${{ inputs.release_sha || inputs.version }} |
| --repo "${{ github.repository }}" \ | ||
| --ref main \ | ||
| -f version="${{ inputs.version }}" | ||
| --ref "${{ inputs.version }}" \ |
| with: | ||
| ref: ${{ inputs.release_sha || inputs.version }} |
|
Closing this in favor of #24. #24 covers the same release/source provenance risk with stricter checks: manual publishes are gated to This PR still leaves a caller-controlled |
Motivation
npm-publish.ymlon the mutablemainref, allowing npm artifacts to be built from a different commit than the GitHub Release and exposing downstream consumers to supply-chain risks.Description
npm-publish.ymlgained an optionalrelease_shainput and pins theactions/checkoutref to${{ inputs.release_sha || inputs.version }}for manual dispatches.Testing
pythoncheck for the ref changes, parsed both YAMLs withruby -e 'require "yaml"; ...', and rangit diff --check, and all checks passed.Codex Task