Skip to content

ci: release skips versions already on npm; npm 11 check survives a published version - #17

Merged
Co-Messi merged 3 commits into
mainfrom
ci/release-skip-published
Oct 9, 2026
Merged

Co-Messi merged 3 commits into
mainfrom
ci/release-skip-published

Conversation

@Co-Messi

@Co-Messi Co-Messi commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

0.1.0 was published to npm by hand, so the repo has no v0.1.0 tag and no GitHub release. Pushing the tag today would run release.yml, which would fail trying to publish 0.1.0 again (and NPM_TOKEN is not set).

Change

release.yml is split into two jobs:

  • check: verifies the tag matches package.json, then looks the version up on npm. If it is already there, it writes a notice and sets published=true.
  • publish: needs check and only runs when the version is not on npm. Same steps as before (install, build, check:pack, unit tests, publish with provenance).

A failed lookup (network error, missing package) counts as unpublished, so a real publish still runs and fails loudly. id-token: write moves from the workflow to the publish job, the only job that mints a provenance token.

Also: CI's npm 11 check broke once 0.1.0 was published

The first CI run on this PR failed in packed-install-smoke: the npm 11 publish --dry-run step from #16 now gets You cannot publish over the previously published versions: 0.1.0. It would fail on every push until the next version bump. The step now runs npm pkg fix with npm 11.6.2 and fails if package.json changes. pkg fix applies the same corrections publish does, without the registry check. Tested locally: with "./dist/cli/index.js" it rewrites the bin; on the current package.json it changes nothing. The CHANGELOG line describing the step is updated to match.

Verification

  • The lookup script, run locally: @co-messi/supercut@0.1.0 gives published=true, 0.1.1 gives published=false, a missing package gives published=false.
  • actionlint 1.7.12 is clean on release.yml and ci.yml.
  • The workflow files are outside the package files list, so tagging this commit as v0.1.0 tags the same package contents that are on npm.
  • PR CI does not run release.yml (it triggers on v* tags only). The real check is the v0.1.0 tag run after merge: check green, publish skipped.

A hand published version (0.1.0) can now get its tag and GitHub release
without the tag run failing on "cannot publish over". The check job
verifies the tag and looks the version up on npm; the publish job only
runs when it is not there. A failed lookup counts as unpublished, so a
real publish still fails loudly. id-token: write moves to the publish
job, the only one that mints a provenance token.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T11:00:41.489610Z 5f30562 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

npm 11's publish --dry-run refuses a version already on npm ("cannot
publish over the previously published versions"), so after 0.1.0 went
out the packed-install-smoke job failed on every push. npm pkg fix
applies the same package.json corrections without asking the registry:
on a ./ prefixed bin it rewrites the path, and on the current
package.json it changes nothing. The step fails on any rewrite.
@Co-Messi Co-Messi changed the title ci(release): skip the publish when the tagged version is already on npm ci: release skips versions already on npm; npm 11 check survives a published version Oct 9, 2026
0.1.0 was published to npm on 2026-10-09.
@Co-Messi
Co-Messi merged commit a06aa22 into main Oct 9, 2026
4 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