Trigger Publish workflow on release published, not push to main - #61
Merged
Conversation
Aligns with the pattern used by JLarky/lima-escape and JLarky/lima-code: real publishes only happen when a GitHub release is actually published. The companion create-release workflow already drafts a release on jsr.json changes, so the loop closes naturally — bump version, review the draft, click Publish release, OIDC fires the publish. bunx jsr publish was already a no-op on already-published versions (emits "Skipping, already published" and exits 0), so this isn't a correctness fix — but it makes the workflow's intent match what actually causes a publish, and matches the pattern used by other @JLarky packages. workflow_dispatch is kept as an escape hatch.
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.
Summary
Align the JSR Publish trigger with the pattern used in JLarky/lima-escape and JLarky/lima-code: real publishes only happen when a GitHub release is actually published.
on: { - push: { - branches: ["main"], - }, + release: { types: ["published"] }, + workflow_dispatch: {}, },Why this isn't a correctness fix
`bunx jsr publish` already no-ops on already-published versions (`Warning: Skipping, already published @jlarky/gha-ts@0.2.1`, exit 0), so the previous trigger wasn't producing red CI. This is purely a clarity change — the workflow's trigger now matches the event that actually causes a publish, and matches the convention used across the other @JLarky Deno packages.
Release flow (already in place)
`workflow_dispatch` is kept so the workflow can still be triggered manually if needed.
Test plan
🤖 Generated with Claude Code
Summary by cubic
Switch the Publish workflow to run on GitHub release publish instead of pushes to
main, keeping manual runs viaworkflow_dispatch. This matches other@jlarkypackages and avoids unnecessary runs.release: ["published"]; removepush: branches: ["main"].workflow_dispatchfor manual triggers.bunx jsr publishalready no-ops on published versions.Written for commit 891c979. Summary will update on new commits.