Skip to content

ci(napi): gate the npm publish behind an explicit dispatch input - #83

Merged
jamesyong-42 merged 1 commit into
mainfrom
fix/napi-dispatch-publish-gate
Jul 26, 2026
Merged

ci(napi): gate the npm publish behind an explicit dispatch input#83
jamesyong-42 merged 1 commit into
mainfrom
fix/napi-dispatch-publish-gate

Conversation

@jamesyong-42

Copy link
Copy Markdown
Member

The trap

napi-build.yml's header calls workflow_dispatch "useful for debugging", but its publish job had no condition. Every manual dispatch ran the full 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 Windows-on-ARM target in #82 needed a throwaway probe workflow rather than just dispatching this one.

Change

Verification

Both directions were proven on this branch before the release side was wired, using a temporarily trimmed matrix and an echo in place of the publish command:

dispatch Build Test Publish
no input success success skipped
-f publish=true success success 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: 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=true flag is ever dropped from release.yml, the native package never reaches npm and the release stops at the existing Require @vibecook/spaghetti-sdk-native on npm gate, 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

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
@jamesyong-42
jamesyong-42 merged commit 7a350ab into main Jul 26, 2026
6 checks passed
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.

1 participant