ci(napi): gate the npm publish behind an explicit dispatch input - #83
Merged
Conversation
napi-build.yml's header called workflow_dispatch "useful for debugging",
but its publish job had no condition — so every manual dispatch ran the
matrix and then attempted an npm publish. There was no way to exercise a
build without reaching for the registry, which is why verifying the new
Windows-on-ARM target needed a throwaway probe workflow instead.
Add a `publish` input (boolean, default false) and gate the publish job
on it. release.yml now passes `-f publish=true`, so release behaviour is
unchanged; a bare dispatch builds and load-tests only.
Both directions were verified on this branch before the release side was
wired, using a temporarily trimmed matrix and an echo in place of the
publish command:
dispatch, no input -> Build success, Test success, Publish SKIPPED
dispatch -f publish=true -> Build success, Test success, Publish success
"PROBE: would run npm publish (publish input
evaluated TRUE)"
That second run used the exact invocation release.yml issues, which is
what confirms `gh workflow run -f publish=true` coerces to a boolean the
`if: ${{ inputs.publish }}` condition accepts.
Failure mode if the flag is ever dropped: the native package never
reaches npm and the release stops at release.yml's "Require
@vibecook/spaghetti-sdk-native on npm" gate, which already refuses to
publish the SDK and CLI without it. Loud and recoverable, not silent.
Also corrects the header's target count, stale at 5 since the ARM64
Windows target landed.
Claude-Session: https://claude.ai/code/session_01LQt9EvHYXCd2U4ZJMfMm4E
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.
The trap
napi-build.yml's header callsworkflow_dispatch"useful for debugging", but its publish job had no condition. Every manual dispatch ran the full matrix and then attempted annpm publish. There was no way to exercise a build without reaching for the registry — which is why verifying the Windows-on-ARM target in #82 needed a throwaway probe workflow rather than just dispatching this one.Change
publishinput (boolean, defaultfalse); publish job gated onif: ${{ inputs.publish }}release.ymlpasses-f publish=true, so release behaviour is unchangedVerification
Both directions were proven on this branch before the release side was wired, using a temporarily trimmed matrix and an
echoin place of the publish command:-f publish=trueThat second run used the exact invocation
release.ymlissues, which is what confirmsgh workflow run -f publish=truecoerces to a boolean theif:condition accepts — the one thing that couldn't be reasoned about safely.The trimmed matrix and the echo were reverted before this PR; the diff touches only the input, the condition, the release-side flag, and comments. Confirmed zero matrix entries removed.
Failure mode
If the
-f publish=trueflag is ever dropped fromrelease.yml, the native package never reaches npm and the release stops at the existingRequire @vibecook/spaghetti-sdk-native on npmgate, which already refuses to publish the SDK and CLI without it.Loud and recoverable, not silent — no partial or broken release is possible.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LQt9EvHYXCd2U4ZJMfMm4E