ci: skip the R2 publish for non-tag builds instead of failing - #74
Merged
Merged
Conversation
nclaw's Desktop Windows Build succeeded on main today (run 34888596818, the
first green desktop build in weeks). Two seconds later this workflow fired on
its workflow_run and went red:
::error::Resolved tag 'main' does not look like a version tag
(expected vX.Y.Z...). Refusing to publish.
The refusal is correct — a branch build is not a release and must not be
published. The exit code is not: it turns every successful non-tag desktop
build into a red X on main, and it will recur on each one now that those
builds pass.
Require the upstream run to be a tag build in the job's own `if`, so the job
skips rather than starts and fails. head_branch carries the tag name for a
tag-triggered upstream run and the branch name otherwise, which is exactly the
discriminator needed.
This mirrors the convention linux-sign.yml already documents for its gate-open
state: a bare red X reads as "something is broken" when the real state is
"nothing to publish here."
The in-step validation stays. It still catches a malformed workflow_dispatch
input such as "1.4.0", which the job-level check deliberately does not gate.
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.
What happened
nclaw's Desktop Windows Build succeeded on main today — run
34888596818, the first green desktop build in weeks. Two seconds laterpublish-r2.ymlfired on itsworkflow_runand went red:Why this is a bug
The refusal is correct — a branch build is not a release and must not be published to
packages.nself.org. The exit code is not.The upstream workflows (
Desktop macOS Build,Desktop Windows Build,Sign Linux Artifacts) run on ordinary branch pushes as well as tags. So every successful non-tag desktop build now turns main red, and it will recur on each one, because those builds have only just started passing.Refusing to publish something that was never publishable is not a failure.
Fix
Require the upstream run to be a tag build in the job's own
if, so the job skips rather than starts and fails:head_branchcarries the tag name for a tag-triggered upstream run and the branch name otherwise — exactly the discriminator needed. The file's existing header comment already explains this subtlety; it just was not applied to the trigger condition.This mirrors the convention
linux-sign.ymldocuments at length for its own gate-open state: "a bare red X here reads as 'something is broken' when the real state is 'nothing to fix'".Not weakened
The in-step
Resolve and validate release versioncheck stays exactly as it is. It still catches a malformedworkflow_dispatchinput such as1.4.0, which the job-level condition deliberately does not gate. Nothing that could previously publish is now blocked, and nothing that was previously blocked can now publish.