Make the action say which build of itself ran (#21) - #22
Open
SebHenn wants to merge 1 commit into
Open
Conversation
`@v1` and `:latest` are both moving references, and a runner may serve either from cache, so nothing in a step's output identified the build that produced it. A fix that shipped weeks ago was indistinguishable from a fix that does not work — which is exactly how #21 was diagnosed, from a clone whose `v1` was stale because `git fetch` does not move an existing tag. (The tag itself was moved by `finalize` on release day; `git ls-remote` confirms v1 == v0.3.1.) The action now stamps its own version and prints one provenance line before it runs anything, repeating it under the step summary and the PR comment: cifail action v0.3.1 (SebHenn/ci-failure-intelligence@v1) | cifail 0.3.1 | image ghcr.io/sebhenn/cifail:latest@sha256:... It names three separately-moving things: the action build, the CLI inside the image, and the image's immutable digest (RepoDigests, not the tag the caller wrote). Also exposed as the `action-version` and `image-digest` outputs. Printing it first means it survives a `docker run` that dies. A stamp nobody checks would lie in precisely the situation it exists for, so check-versions.sh (already run on every PR) fails when it drifts from Directory.Build.props, and ci.yml's existing step-script harness asserts the rendered line. release.yml's v1 move is guarded on both sides while here: skipped when the tag being released is not the newest version tag (re-releasing an older patch line must not drag v1 backwards), and verified against `git ls-remote` afterwards, because a fire-and-forget force-push left the job green either way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fixes the actionable half of #21.
The tag was already correct
The issue's premise — that
v1still points at v0.3.0 — does not hold against the remote:release.yml'sfinalizemoved it at 18:58 on release day, ~18h before the issue wasfiled, and
action.ymlatv1has theset +efix at line 96. What the report observed wasa stale local tag:
git fetchdoes not move a tag that already exists locally, so anyclone that had ever seen
v1kept reporting the old commit. This repo's own clone reproducedit exactly (
! [rejected] v1 -> v1 (would clobber existing tag)).That makes the second half of the issue the real defect: nothing in the action's output
named the build that ran, so the wrong conclusion was the reasonable one.
What changed
action.ymlstamps its own version and prints one line before it runs anything — repeatedunder the step summary and the PR comment, and exposed as the
action-version/image-digestoutputs:Three separately-moving things, named: the action build, the CLI inside the image, and the
image's immutable digest (
RepoDigests, not the tag the caller wrote —:latestmoves too,and runners cache). Printed first, so it survives a
docker runthat dies.A stamp nobody checks lies in exactly the situation it exists for, so:
scripts/check-versions.sh(already run on every PR) fails when the stamp drifts fromDirectory.Build.props— verified by planting9.9.9and watching it fail;ci.yml's existing step-script harness asserts the rendered line. The${{ github.action_ref }}plumbing can only be exercised by a realuses:, so the testpasses those vars in explicitly and pins the rendering.
Also, since it is the same failure mode
release.yml'sv1move is now guarded on both sides: skipped when the tag beingreleased is not the newest version tag (re-releasing an older patch line must not drag
v1backwards), and verified against
git ls-remoteafterwards — previously the force-pushwas fire-and-forget and the job went green whether or not it landed.
Verification
Docker isn't available on the dev box, so the step script was extracted with
ci.yml's ownextractor and run against a stand-in that shells out to the real CLI: provenance renders
correctly for
@v1, for a localuses: ./checkout, and for an image with noRepoDigests;gatemode, the exit-2 usage path, and the SARIF write all still behave. YAML parses, allshell bodies pass
bash -n,check-versions.shpasses.🤖 Generated with Claude Code