fix(action): default the binary version to the pinned action ref - #170
Open
laurigates wants to merge 1 commit into
Open
fix(action): default the binary version to the pinned action ref#170laurigates wants to merge 1 commit into
laurigates wants to merge 1 commit into
Conversation
`inputs.version` defaulted to `latest`, so a workflow pinned to a commit SHA still resolved the newest release at install time. A new release could then change gate behaviour on a repo whose workflow file and hubs had not changed, and a `surf check` verdict is a merge gate. Default it to the workspace version bundled at the action ref instead, read from Cargo.toml via a new scripts/workspace-version.sh that bump-docs-version.sh now shares — keeping Cargo.toml the single source for the released version rather than adding a second file to keep in sync. Because action.yml, the installer and that script are all read at the pinned ref, a SHA-pinned `uses:` now transitively pins the binary, completing for the version what Connorrmcd6#118 did for the installer script. Resolution fails closed: falling back to `latest` when the version cannot be read would silently restore the floating install this default prevents. An explicit `version:` still wins and `version: latest` keeps the old behaviour. Closes Connorrmcd6#169 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JdgCRGoLu4BD4gW744VbU3
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.
Closes #169.
inputs.versiondefaulted tolatest, so a workflow pinned to a commit SHA still installed whatever the newest release happened to be at run time. A release could then change asurf checkverdict on a repo whose workflow file and hubs had not changed.The default now resolves to the workspace version bundled at the action ref, so a pinned
uses:pins the binary as well — the version half of what #118 did for the installer script. An explicitversion:still wins, andversion: latestkeeps the floating behaviour.Two notes on the approach:
VERSIONfile. The issue suggested writing the tag to aVERSIONfile at release prep. I readCargo.tomlinstead, since CONTRIBUTING already calls it the single source for the released version and a second file can drift from it silently.scripts/workspace-version.shnow holds that one parser, andscripts/bump-docs-version.sh— which was already parsingCargo.toml— calls it rather than duplicating the awk.version:input. Falling back tolatestthere would quietly reintroduce the floating install this default exists to prevent.Happy to switch to the
VERSIONfile if you'd rather keep the release metadata out of the action path.Verification
Gates, on this branch:
End to end on a runner — scratch workflow on my fork consuming this branch as
uses: ./(run, all four jobs green):versioninputsurf: downloading v0.8.0 (x86_64-unknown-linux-gnu)→surf 0.8.0v0.7.0surf: downloading v0.7.0 (x86_64-unknown-linux-gnu)→surf 0.7.0latestsurf 0.8.0surf check: all anchored spans match their stored hashes.And the fail-closed path, with the version script absent from the action path:
One thing to expect:
ci.yml'spull_requestpaths filter doesn't coveraction.yml,scripts/,docs/orCHANGELOG.md, so no CI run will attach to this PR. The gate output above is from running them locally.🤖 Generated with Claude Code