Skip to content

ci: fix Release pipeline so merges publish to npm; idempotent GH Packages - #3

Merged
WomB0ComB0 merged 1 commit into
masterfrom
fix/release-pipeline
Jun 16, 2026
Merged

ci: fix Release pipeline so merges publish to npm; idempotent GH Packages#3
WomB0ComB0 merged 1 commit into
masterfrom
fix/release-pipeline

Conversation

@WomB0ComB0

Copy link
Copy Markdown
Member

Problem

The Release workflow has failed on every push to master, and npm has been frozen at 0.4.0 since March 17. Two independent bugs:

1. npm never publishes on PR merges

The job used JoshuaKGoldberg/release-it-action, which gates on should-semantic-release. That tool returns false for "Merge pull request #N" HEAD commits — and this repo merges PRs with merge commits:

Checking commit: Merge pull request #2 … Found a release commit. Returning false.

So release-it never ran → nothing reached npmjs.

2. The job crashed every run on GitHub Packages

npm error You cannot publish over the previously published versions: 0.4.1.

The "Publish to GitHub Packages" step always re-published the current version. 0.4.1 was cut to GitHub Packages once (but never to npmjs), so the step has hard-failed ever since.

Fix

  • Call release-it directly (bunx release-it --ci) instead of release-it-action. Its conventional-changelog plugin reads the full commit range since the last tag and computes the bump regardless of merge strategy, so normal PR merges now release.
  • Job-level if skips the run triggered by release-it's own chore: release vX commit — replacing the re-trigger guard the action used to provide (no release loop).
  • Idempotent GitHub Packages step — skips if the version already exists instead of failing the job.
  • workflow_dispatch added for manual releases.
  • .release-it.json: requireCommitsFail: false → no-op pushes skip cleanly.
  • cspell.json: allow inlines / pyproject → fixes the red Lint Spelling check.

Before merging — two prerequisites

  1. NPM_TOKEN secret must be a valid npm automation token. This is what the pipeline publishes with; it has been untested since the gate blocked release-it entirely. If it is stale, the npm publish will fail.
  2. A 0.4.1 git tag needs to exist on the repo (it does not today — only 0.2.0/0.3.0/0.4.0). The commit 0aa90ce is literally chore: release v0.4.1, so tagging it reconciles history and makes the next release compute to 0.4.2 (not a duplicate 0.4.1). (Being pushed alongside this PR.)

On merge

release-it computes a patch bump from the fix: commits since 0.4.1 → cuts 0.4.2: updates CHANGELOG.md, tags 0.4.2, creates the GitHub release, and publishes to both npmjs and GitHub Packages. That ships the security fixes (PR #1) + the vitest bump (PR #2) to the public registry.

Validation (local)

  • bun run lint:spelling0 issues
  • .release-it.json + cspell.json valid JSON; release.yml valid YAML (triggers push+workflow_dispatch, if guard parses, 8 steps)
  • release-it --dry-run reaches the publish step (only stops on local npm auth, as expected)

…ages

The Release workflow has been failing on every push to master and npm has been
stuck at 0.4.0 since March. Two bugs:

1. npm never publishes on PR merges. release-it-action gates on
   should-semantic-release, which returns false for "Merge pull request #N"
   HEAD commits. This repo merges PRs with merge commits, so a release was
   never triggered. Replace the action with a direct `bunx release-it --ci`
   call -- conventional-changelog reads the full commit range since the last
   tag and computes the bump regardless of merge strategy. A job-level `if`
   skips release-it's own "chore: release vX" commit to prevent a re-trigger
   loop (the guard the action used to provide). Also adds workflow_dispatch
   for manual releases.

2. The job crashed every run at "Publish to GitHub Packages":
   `npm error You cannot publish over the previously published versions`.
   The step always re-published the current version. Make it idempotent:
   skip if the version already exists on GitHub Packages.

Supporting changes:
- .release-it.json: requireCommitsFail=false so no-op pushes skip cleanly
  instead of failing the job.
- cspell.json: allow "inlines" and "pyproject" (from src/utils/local-content.ts)
  to fix the Lint Spelling check.
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi @WomB0ComB0, thanks for the pull request! A scan flagged some concerns with it. Could you please take a look?

[pr-linked-issue] This pull request is not linked as closing any issues. This repository keeps to GitHub issues for discussing potential changes. Most or all changes should be marked as approved in an issue before a pull request is sent to resolve them. To resolve this report:

  • If this is a straightforward documentation change that doesn't need an issue, you can ignore this report
  • If there is a backing issue, add a 'fixes #...' link to the pull request body
  • Otherwise, file an issue explaining what you'd like to happen

[pr-task-completion] This PR's body is missing [x] checks on the following tasks from the PR template.

Repositories often provide a set of tasks that pull request authors are expected to complete. Those tasks should be marked as completed with a [x] in the pull request description. Please complete those tasks and mark the checks as [x] completed.

🗺️ This message was posted automatically by OctoGuide: a bot for GitHub repository best practices.

@WomB0ComB0
WomB0ComB0 merged commit ac7cf30 into master Jun 16, 2026
13 of 14 checks passed
@WomB0ComB0
WomB0ComB0 deleted the fix/release-pipeline branch June 16, 2026 09:34
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