npm-publish: also publish for manual ci dispatches on main#7886
Merged
Conversation
The npm-publish job only proceeded for `push`-triggered `ci` runs, so a green
`ci` started via `workflow_dispatch` on main was skipped. The parser is launched
downstream via `npx --package=@openrewrite/rewrite@<version>`, where `<version>`
is the commit-timestamp baked into the `rewrite-javascript` jar's
`rewrite-javascript-version.txt`. A commit whose only green `ci` came from a
manual dispatch therefore never publishes its parser to npm, leaving consumers'
Maven snapshots pointing at a version that 404s ("RPC process shut down early").
Allow `workflow_dispatch`-triggered `ci` runs on main to publish too. The
`conclusion == 'success'` and `head_branch == 'main'` guards still apply, so PRs
and non-main dispatches remain excluded.
greg-at-moderne
approved these changes
Jun 3, 2026
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.
Problem
npm-publishonly proceeds forpush-triggeredciruns onmain:So a green
cistarted viaworkflow_dispatchonmaintriggersnpm-publish(theworkflow_runfires) but the job is skipped.That matters because of how the parser is resolved downstream. The
rewrite-javascriptjar bundlesrewrite-javascript-version.txt=8.84.0-<git-commit-timestamp>, and consumers launch the parser vianpx --package=@openrewrite/rewrite@<that-version> rewrite-rpc. The npm package is published with the same commit-timestamp version. So a commit whose only greencicame from a manual dispatch (e.g. after re-running a flaky build to green) never gets its parser published to npm — and any consumer resolving that commit's Maven snapshot then fails withRPC process shut down early with exit code 1(thenpx404).Change
Allow
workflow_dispatch-triggeredciruns onmainto publish, in addition topush:The
conclusion == 'success'andhead_branch == 'main'guards are unchanged, so PRs and non-maindispatches remain excluded, and a redcistill won't publish. The existing "version already published → skip" guard makes re-dispatching a no-op.Notes
workflow_runworkflows execute the default-branch copy of the YAML, so this takes effect once merged tomain(it won't retroactively publish already-skipped runs).ciskips the JS publish even though the JS build is green.