Repository navigation
Add a versioned verify action (actions/verify) - #306
Open
nodeselector wants to merge 20 commits into
Open
nodeselector wants to merge 20 commits into
nodeselector wants to merge 20 commits into
Conversation
…ens off github.com
A $/ reference runs actions/verify at the workflow's own commit, which avoids a local ./ reference. The action has no uses:, so it needs no lockfile entry.
There was a problem hiding this comment.
🟡 Changes recommended
The stamp test breaks make test and releases on Linux hosts with sha256sum but no shasum, while the installer lacks automated coverage for checksum validation and GHE.com token isolation.
2 open issues
What changed in this PR
Adds an official, versioned verification action so repositories can reuse lockfile checks and receive CLI upgrades through Dependabot.
Changes:
- Add a cross-platform composite action that verifies downloaded binaries using stamped checksums or release attestations.
- Extend releases to publish stamped
verify-v*tags, with tests for the stamping script. - Adopt the local action in this repository and document usage, authentication, and release behavior.
| File | Description |
|---|---|
skills/gh-actions-lock/SKILL.md |
Recommend the shared action for CI verification. |
script/stamp-verify-action-test |
Test version and checksum stamping. |
script/stamp-verify-action |
Stamp the action’s default version and binary checksums. |
RELEASING.md |
Document publication of versioned action tags. |
README.md |
Add workflow examples and authentication guidance. |
Makefile |
Include stamping tests in release checks. |
actions/verify/README.md |
Document action inputs, platforms, and token requirements. |
actions/verify/install.sh |
Download and validate the runner-specific CLI binary. |
actions/verify/action.yml |
Define installation and CLI execution steps. |
.github/workflows/verify-lockfile.yml |
Run the local action with an explicit CLI version. |
.github/workflows/release.yml |
Verify release assets and publish stamped action tags. |
Review effort: Max (adaptive)
Moves the download, checksum and attestation checks and the CLI run from bash into actions/verify/lib.mjs and verify.mjs, with node:test unit tests. action.yml is a single step that calls verify.mjs.
script/verify-action-release.mjs replaces the bash stamp script and the inline release workflow steps.
The action is now a node24 JavaScript action, so it no longer needs a shell step or curl. The download streams fetch to disk with exponential backoff on the statuses curl --retry treated as transient, and goes through HTTPS_PROXY/HTTP_PROXY/NO_PROXY like curl did. Runners whose node24 predates http.setGlobalProxyFromEnv re-run the script with NODE_USE_ENV_PROXY=1. A missing gh now says it's needed for the attestation check.
Git object files are read-only, so rm -r prompts for each one when stdin is a terminal and fails the run if any answer isn't yes.
The action read its default version from a stamped comment in action.yml and a '# vX.Y.Z' header in checksums.txt. Both comments were load-bearing. Now checksums.json holds the version and the per-asset sha256, the version input defaults to empty and falls back to it, and only that file is stamped.
The release workflow commits the new checksums.json on a verify-stamp-<tag> branch off main, opens the pull request, and dispatches the test and verify-lockfile workflows on it, since pull requests opened by the workflow token don't trigger pull_request runs. Reruns reuse the branch and pull request. Release candidates and releases that aren't the latest skip it.
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.


Resolves #293
github/gh-actions-lock/actions/verify, a Node action (node24) that downloads a checkedgh-actions-lockrelease binary and runs--verify. Repos can pin it and let Dependabot bump it instead of copyingverify-lockfile.yml.token(defaultgithub.token),version(CLI release),args(default--verify).node24(self-hosted runners need v2.327.1 or later). The download usesfetchwith retries and backoff, and honorsHTTPS_PROXY/HTTP_PROXY/NO_PROXY. The release stamping isscript/verify-action-release.mjs. Both havenode --testsuites that run in CI on Linux and Windows.versionchecks the binary withgh attestation verify, so that path needsghonPATH. Hosted runners have it; the default path doesn't need it.vX.Y.Znow also publishesverify-vX.Y.Z. The release workflow records the version and the release binaries' checksums inactions/verify/checksums.json, commits that on top of the release commit and tags it. Theversioninput defaults to that recorded version. Nobody hand-edits it, and no comment is parsed.verify-v*tags because the stamp commit holds checksums of binaries built from its parent, so it can't be thevX.Y.Zcommit onmain. Dependabot bumps within theverify-vprefix.checksums.jsonfor the recorded version, or the release's build attestation for any otherversion. On GHE.com the attestation check usesGH_ACTIONS_LOCK_GITHUB_COM_TOKENso the tenant token stays on the tenant.GITHUB_TOKENcan't read private or internal actions in other repositories, even when the Actions access setting lets the runner use them. Pass a GitHub App installation token with read access astoken.verify-lockfile.ymlruns$/actions/verifywith noversion, so it tests the action at the PR's own commit through the same stamped-checksum path consumers get. The action has nouses:, so it needs no lockfile entry.maincarries a stamp too (v0.5.1 here). It can't land with its own release, because the binaries embed the commit they're built from. After a stable release, the release workflow opens a "Stamp actions/verify on main for vX.Y.Z" PR from averify-stamp-vX.Y.Zbranch and dispatchestestandverify-lockfileon it, since PRs opened by the workflow token don't triggerpull_requestruns. That's why those two workflows gainedworkflow_dispatchand the release job gainedpull-requests: writeandactions: write.script/releasewon't cut the next release until that PR is merged;--stamp-onlyis the manual fallback.script/releasereruns are safe: after a held push it pushes the existing local tag if it's atHEAD(and fails if it isn't), andscript/release-testno longer prompts while cleaning up.--stamp-onlyon an already-stamped tree is a no-op, and a rerun of the release workflow re-checks the attestations, then leavesverify-vX.Y.Zalone if it's already that exact signed stamp on the release commit, and reuses the stamp branch and PR.