ci: publish on version change instead of via release-please - #206
Merged
Conversation
release-please could not run: creating the release PR needs the repo setting "Allow GitHub Actions to create and approve pull requests", which is off, and job-level pull-requests: write does not substitute for it. The run failed before the publish job started, so nothing was published. Rather than widen Actions permissions, drop the Actions-authored PR. The workflow now compares package.json's version against npm and publishes when it is not there yet. The bump arrives as an ordinary pull request opened by a person or an agent, so the merge checkpoint before an irreversible publish is unchanged, and Actions never authors a PR. Detection queries the exact version rather than `latest`, so re-runs are idempotent. Verified against the live registry: 1.2.11 resolves and is skipped, 1.3.0 does not and would publish. Also tags the release after a successful publish. Tags here had drifted badly — the newest was v1.1.51 while npm was on 1.2.11 — and tagging as part of publishing keeps them honest. Removes the release-please config and manifest, now unused. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
🚀 Preview deployment is ready! You can view the preview at: https://pr-ui-preview-206.surge.sh |
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.
Fixes the failed run: 30199878445.
What actually broke
Not the publish — the
publishjob never started (0s).release-pleasefailed first:That is the repo setting Actions → General → Workflow permissions → "Allow GitHub Actions to create and approve pull requests", which is off (
can_approve_pull_request_reviews: false). Job-levelpull-requests: writedoes not substitute for it — it is a separate toggle.Nothing was published. npm is still on 1.2.11 from 8 June, and the trusted-publisher config you added was never exercised.
The fix, without widening Actions permissions
Drop the Actions-authored PR entirely. The workflow now compares
package.json's version against npm and publishes when it isn't there yet. The bump arrives as an ordinary pull request opened by a person or an agent.So the merge checkpoint before an irreversible publish is unchanged, and Actions never authors a PR — no repo setting to change, no credential, and arguably tighter than granting Actions PR-authoring rights repo-wide.
Version detection queries the exact version rather than
latest, so re-runs are idempotent and backfilling an older version is still recognised as published. Verified against the live registry:npm viewAlso
Tags the release after a successful publish. Tags here had drifted badly — newest was
v1.1.51while npm was on 1.2.11, with two different formats in use — so tagging as part of publishing keeps them honest going forward.Removes
release-please-config.jsonand.release-please-manifest.json, now unused. The gates (package check, publint, attw) are unchanged.Next
This alone publishes nothing — master is 1.2.11, which is already on npm, so merging it is a no-op. The release itself is a separate version-bump PR to 1.3.0, which I'll open once this lands.
🤖 Generated with Claude Code