fix(ci): derive publish mode from trigger to kill latest overwrite race #373
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GOV-15-twin-trigger-publish-mode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Roll the GOV-13 twin-trigger publish-mode fix into this repo's
build-oci-image.ymland its companionoci-build/get-tags.nu.Why
The workflow triggered on push to both
branches: [main]andtags: [v*]and resolved its tags fromgit describeviaget-tags.nu --joined, returning[vX.Y.Z, latest]on a tagged commit. A release commit is at once a main push and av*tag push, so both workflow events fired, both built the same image, and both raced to overwrite the mutable:latesttag (last writer wins, non-deterministic).How
Port the trigger-derived publish-mode pattern proven in the governance templates: resolve the mode from
github.event_name/github.ref_type(tag ref ->releasepublishes:vX.Y.Zonly, main push ->latestpublishes:latestonly,workflow_dispatch->dry-runthat builds and prints but mutates nothing).get-tags.nunow takes--modeand returns a single disjoint tag per mode, so the two runs of a release commit publish different tags and never collide.Verification
build-oci-image.ymlparses, the rewrittenget-tags.nupassesnu-check, andget-tags.nuwas exercised acrossrelease/latest/dry-run(+ simulate-tag) plus both error paths (exit 1). The repo'sjust pre-commitsuite (fmt, clippy, wasm check, 189 lib tests) passed before the commit landed.Part of the GOV-15 rollout. Links GOV-13 (template fix) and GOV-15 (this rollout).