Skip to content

Make the workflow_dispatch publish path actually publish - #566

Merged
ChrisonSimtian merged 1 commit into
Fallout-build:release/v10.4from
ChrisonSimtian:bugfix/nugetorg-optin-never-matches
Jul 26, 2026
Merged

Make the workflow_dispatch publish path actually publish#566
ChrisonSimtian merged 1 commit into
Fallout-build:release/v10.4from
ChrisonSimtian:bugfix/nugetorg-optin-never-matches

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Collaborator

The workflow_dispatch path on publish-packages-release.yml could never publish anything. It is the documented way to publish to nuget.org and the documented way to retry a partial publish — both silently did nothing while the run reported success.

Found while publishing v10.4.0-rc.4: run 30202826208 shows test + pack: success with all three publish jobs skipped, and a green overall conclusion.

Two independent causes

1. Skip propagation. validate-ref is skipped by design on workflow_dispatch (if: github.event_name == 'push'), and a skipped job propagates through the dependency graph. test-and-pack survives with always() — but that rescues only itself; its dependents still saw a skipped ancestor. This is why publish-github-packages and publish-github-releases skipped despite carrying no condition at all, which is the part that makes the failure so quiet.

2. The boolean compare. The opt-in was inputs.publish-to-nugetorg == true. A type: boolean input is only a real boolean when the run starts from the Actions UI; the REST API can only send strings, and gh workflow run rejects a JSON boolean outright (cannot unmarshal bool into Go value of type string). Comparing a string to a boolean casts both to numbers — 'true' → NaN, true → 1 — so the opt-in never matched from the CLI, including the exact invocation in docs/branching-and-release.md.

Fix

All three publish jobs gate on always() && needs.test-and-pack.result == 'success', and the opt-in accepts the string as well as the boolean.

Tag-push behaviour is unchanged: validate-ref still gates it, and nuget.org still requires both the flag and the nuget-org environment approval. This also makes the runbook's "re-running a publish job is idempotent" claim true for the first time.

Verification

Merging this and re-dispatching for v10.4.0-rc.4 is the test — publish → nuget.org should reach the approval gate instead of skipping. No code change, so Test/Pack are unaffected.

Every job downstream of test-and-pack was unreachable on a workflow_dispatch
run, so the manual path — the documented way to publish to nuget.org, and the
documented way to retry a partial publish — silently published nothing while
reporting success. Two independent causes:

validate-ref is skipped by design on workflow_dispatch (`if: event_name ==
'push'`), and a skipped job propagates through the dependency graph.
test-and-pack survives that with `always()`, but that rescues only itself: its
own dependents still saw a skipped ancestor and were skipped too. This hit all
three publish jobs, including the two that carry no condition of their own.

Separately, the nuget.org opt-in compared `inputs.publish-to-nugetorg == true`.
A `type: boolean` input is only a real boolean when the run starts from the
Actions UI; the REST API can only send strings, and `gh workflow run` rejects a
JSON boolean outright. Comparing a string to a boolean casts both to numbers
('true' → NaN, true → 1), so the opt-in never matched from the CLI — including
the exact invocation in docs/branching-and-release.md.

Both fixed: the publish jobs gate on `always() && needs.test-and-pack.result ==
'success'`, and the opt-in accepts the string as well as the boolean. Tag-push
behaviour is unchanged — validate-ref still gates it, and nuget.org still needs
both the flag and the environment approval.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working target/vCurrent Targets the current version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant