Skip to content

fix(ci): dispatch orb-beta-release against the tag, not the floating main ref - #4680

Merged
JSONbored merged 1 commit into
mainfrom
fix/orb-beta-release-tag-dispatch-race
Jul 10, 2026
Merged

fix(ci): dispatch orb-beta-release against the tag, not the floating main ref#4680
JSONbored merged 1 commit into
mainfrom
fix/orb-beta-release-tag-dispatch-race

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What broke

orb-beta-release.yml's "Dispatch the ORB release build" step fires release-selfhost.yml via
--ref main — the floating branch — instead of the beta tag it had just created and pushed one step
earlier in the same job.

Observed live: orb-v0.4.0-beta.21 was tagged at 347ada8ec. By the time the dispatch fired, a
concurrent merge had moved main to e984eef7c. The dispatched run resolved github.sha to
e984eef7c (from --ref main), while the tag it was supposed to release still pointed at 347ada8ec
tripping release-selfhost.yml's own TAG_SHA-must-equal-RELEASE_SHA fail-safe and aborting. The
fail-safe worked correctly (no bad image built/published), but that day's scheduled beta release was
skipped.

Fix

Dispatch against $TAG instead of main. The tag is immutable once pushed, so github.sha inside the
dispatched run resolves to exactly the commit the tag points to, by construction — closes the race
regardless of how many commits land on main afterward.

Verification

No src/** code touched — this is a .github/workflows/*.yml trigger-logic fix, not unit-testable
without actually triggering a real release (out of scope here). Verified via npm run actionlint (clean)
and manual reasoning about gh workflow run --ref's dispatch semantics.

Fixes #4679

…main ref

The "Dispatch the ORB release build" step fired release-selfhost.yml via
--ref main -- the floating branch -- rather than the beta tag it had just
created and pushed one step earlier in the same job. Any commit landing on
main in the gap between the tag-push step and the dispatch actually being
processed by GitHub resolves github.sha inside the dispatched run to that
newer commit, while the tag (already pushed, immutable) still points at
the older one it was cut for -- tripping release-selfhost.yml's own
TAG_SHA-must-equal-RELEASE_SHA fail-safe and aborting the release.

Observed live: orb-v0.4.0-beta.21 was tagged at 347ada8, but by dispatch
time main had moved to e984eef from a concurrent merge, aborting that
day's scheduled beta release (safely -- no bad image was built).

Dispatch against the tag instead: immutable once pushed, so github.sha
resolves to exactly the commit the tag points to by construction, closing
the race regardless of how many commits land on main afterward.

Fixes #4679
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 10, 2026
@JSONbored
JSONbored merged commit 2b4b5e3 into main Jul 10, 2026
7 checks passed
@JSONbored
JSONbored deleted the fix/orb-beta-release-tag-dispatch-race branch July 10, 2026 11:43
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.14%. Comparing base (e984eef) to head (c737b25).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4680   +/-   ##
=======================================
  Coverage   94.14%   94.14%           
=======================================
  Files         435      435           
  Lines       38566    38566           
  Branches    14060    14060           
=======================================
  Hits        36308    36308           
  Misses       1599     1599           
  Partials      659      659           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

orb-beta-release.yml: dispatch race between tag-push and release-build dispatch

1 participant