Skip to content

Add a versioned verify action (actions/verify) - #306

Open
nodeselector wants to merge 20 commits into
mainfrom
nodeselector-restore-verify-composite-action
Open

nodeselector wants to merge 20 commits into
mainfrom
nodeselector-restore-verify-composite-action

Conversation

@nodeselector

@nodeselector nodeselector commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Resolves #293

  • Adds github/gh-actions-lock/actions/verify, a Node action (node24) that downloads a checked gh-actions-lock release binary and runs --verify. Repos can pin it and let Dependabot bump it instead of copying verify-lockfile.yml.
  • Inputs: token (default github.token), version (CLI release), args (default --verify).
  • Node built-ins only, no npm dependencies, running on the runner's own node24 (self-hosted runners need v2.327.1 or later). The download uses fetch with retries and backoff, and honors HTTPS_PROXY/HTTP_PROXY/NO_PROXY. The release stamping is script/verify-action-release.mjs. Both have node --test suites that run in CI on Linux and Windows.
  • Overriding version checks the binary with gh attestation verify, so that path needs gh on PATH. Hosted runners have it; the default path doesn't need it.
  • Each CLI release vX.Y.Z now also publishes verify-vX.Y.Z. The release workflow records the version and the release binaries' checksums in actions/verify/checksums.json, commits that on top of the release commit and tags it. The version input defaults to that recorded version. Nobody hand-edits it, and no comment is parsed.
  • Separate verify-v* tags because the stamp commit holds checksums of binaries built from its parent, so it can't be the vX.Y.Z commit on main. Dependabot bumps within the verify-v prefix.
  • Binary check: the checksums in checksums.json for the recorded version, or the release's build attestation for any other version. On GHE.com the attestation check uses GH_ACTIONS_LOCK_GITHUB_COM_TOKEN so the tenant token stays on the tenant.
  • Caveat, documented: the default GITHUB_TOKEN can'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 as token.
  • This repo's verify-lockfile.yml runs $/actions/verify with no version, so it tests the action at the PR's own commit through the same stamped-checksum path consumers get. The action has no uses:, so it needs no lockfile entry.
  • main carries 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 a verify-stamp-vX.Y.Z branch and dispatches test and verify-lockfile on it, since PRs opened by the workflow token don't trigger pull_request runs. That's why those two workflows gained workflow_dispatch and the release job gained pull-requests: write and actions: write. script/release won't cut the next release until that PR is merged; --stamp-only is the manual fallback.
  • script/release reruns are safe: after a held push it pushes the existing local tag if it's at HEAD (and fails if it isn't), and script/release-test no longer prompts while cleaning up.
  • The stamp steps skip work that's already done: --stamp-only on an already-stamped tree is a no-op, and a rerun of the release workflow re-checks the attestations, then leaves verify-vX.Y.Z alone if it's already that exact signed stamp on the release commit, and reuses the stamp branch and PR.
  • No CHANGELOG in this repo; release notes cover it.

@nodeselector
nodeselector requested a review from a team as a code owner November 19, 2026 03:45
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 03:45
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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Comment thread script/stamp-verify-action-test Resolved
Comment thread actions/verify/install.sh Resolved
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFE: Create shared action to run lockfile verification

2 participants