Skip to content

fix(release): hand release PR to a human and ship the prebuilt npm bin - #5

Merged
zeldrisho merged 4 commits into
mainfrom
fix/release-human-merge
Aug 8, 2026
Merged

zeldrisho merged 4 commits into
mainfrom
fix/release-human-merge

Conversation

@zeldrisho

@zeldrisho zeldrisho commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Two fixes to the release/packaging pipeline.

1. Release PRs are handed to a human, never auto-merged

Follow-up to #3. The release workflow introduced there auto-merged the release commit (gh pr merge as github-actions[bot]) and used the entire CHANGELOG.md as GitHub release notes.

  • Open release PR and wait for CI now stops after CI passes and prints the PR URL — the release commit is never auto-merged.
  • Merge it with Create a merge commit (not squash/rebase) so the release tag stays on the merged commit.
  • The push from that merge triggers the follow-up run, which resumes the release idempotently and only then publishes to npm and creates the GitHub release (on_main=true gating).
  • Release notes now cover only the current release (first ## [v…] section of CHANGELOG.md).

2. The npm iconsur bin runs the prebuilt bundle

The published bin pointed at src/index.ts, which Node 24 refuses to execute under node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING) — every installed iconsur command crashed with that error.

  • bin now points at dist/index.cjs (the tsdown bundle already produced by vp pack), rebuilt by a new prepack script on npm pack / pnpm publish.
  • The release workflow builds the pkg binaries after the npm publish step so prepack never packs them into the npm tarball; they are rebuilt immediately before the GitHub release. Gated on on_main like publish and the GitHub release.

3. Docs

  • docs/release.md documents the human-merge flow and adds a References section.
  • docs/development.md notes the prebuilt-bin packaging; README reflects the npm install behavior.

The release workflow previously merged the release commit to main itself
via `gh pr merge` (github-actions[bot]). Replace the auto-merge with a
handoff: the workflow opens PR release/vX.Y.Z, waits for the CI check,
and stops with a notice. A human merges it with 'Create a merge commit';
the follow-up run triggered by that merge resumes the release
idempotently and only then publishes to npm and creates the GitHub
release (both steps are now gated on the release commit being on main).

GitHub release notes previously used the whole CHANGELOG.md as the body,
which included ancient, non-conventional commit history ('Unset',
'Workflow', 'V1.0', ...). Notes now cover only the current release (the
first `## [v…]` section of CHANGELOG.md).

Also add the git-cliff docs (git-cliff.org/docs; git-cliff.com does not
resolve) as a reference in docs/release.md and docs/development.md, and
document the human-merge release flow.
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@zeldrisho, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 68c8fca5-75a9-4173-ae53-c5212f6493a5

📥 Commits

Reviewing files that changed from the base of the PR and between a90cb8c and 774c715.

📒 Files selected for processing (6)
  • .github/workflows/release.yml
  • README.md
  • docs/development.md
  • docs/release.md
  • package.json
  • src/index.ts
📝 Walkthrough

Walkthrough

The release workflow now opens a release PR without auto-merging it. After a human merges it onto main, the workflow publishes to npm and creates a GitHub release with notes from the current changelog section. Documentation describes this process and links to git-cliff references.

Changes

Release workflow and documentation

Layer / File(s) Summary
Release PR and publishing gates
.github/workflows/release.yml
The workflow waits for CI, records whether the release commit is on main, and stops auto-merging and branch deletion. npm publishing and GitHub release creation now require the commit to be on main. Release notes use only the current changelog section.
Release procedure documentation
docs/development.md, docs/release.md
The documentation describes manual release PR merging, the follow-up workflow run, merge-commit requirements, release notes, and git-cliff references.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Maintainer
  participant ReleaseWorkflow as Release workflow
  participant CI
  participant Main as main
  participant NPM
  participant GitHubRelease as GitHub release

  ReleaseWorkflow->>Maintainer: Open release PR
  ReleaseWorkflow->>CI: Wait for required checks
  CI-->>ReleaseWorkflow: Report success
  Maintainer->>Main: Merge release PR
  Main-->>ReleaseWorkflow: Confirm release commit
  ReleaseWorkflow->>NPM: Publish package
  ReleaseWorkflow->>GitHubRelease: Create release with current changelog notes
Loading

Possibly related PRs

  • zeldrisho/iconsur#3: Both changes modify the release workflow and defer publishing until the release commit is on main.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main workflow change and the npm publishing update described in the pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-human-merge

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 209-214: Update the NOTES extraction in the release workflow to
anchor on the exact ## [${RELEASE_VERSION}] changelog heading, then capture
content until the next ## [ heading. Make the awk command fail closed by exiting
nonzero when that version section is absent, rather than returning the full
changelog; preserve the existing gh release create usage with NOTES.
- Line 140: Update the release workflow’s on_main/tag validation around the
on_main output so it requires the tag commit’s tree to match HEAD^{tree}, rather
than only accepting the tag as an ancestor. If the trees differ, stop the
release path; otherwise preserve the existing follow-up build and npm publish
behavior.
- Line 149: Update the release PR creation command’s --body value to provide
actual line breaks between the release message and merge instructions, using
printf, a heredoc, or --body-file instead of embedded literal \n sequences.
Preserve the existing text and formatting as separate paragraphs.
- Around line 160-169: Update the CI conclusion case handling in the release
workflow’s polling loop to explicitly handle NEUTRAL, STALE, SKIPPED,
STARTUP_FAILURE, TIMED_OUT, and ACTION_REQUIRED for the “Check, test, and build”
check. Fail the workflow with a clear error for these terminal non-success
states instead of continuing to poll until timeout, while preserving the
existing SUCCESS behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7b9750fd-9910-4df1-a59e-d9684f5d41e8

📥 Commits

Reviewing files that changed from the base of the PR and between 4478bdd and a90cb8c.

📒 Files selected for processing (3)
  • .github/workflows/release.yml
  • docs/development.md
  • docs/release.md

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml Outdated
The published package's bin pointed at src/index.ts, which Node 24 refuses
to execute under node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING),
so an installed `iconsur` crashed on every command. Point the bin at the
prebuilt dist/index.cjs (already produced by vp pack) and rebuild it in a
new prepack hook so npm pack/pnpm publish always ship a fresh bundle.

The release workflow builds the pkg binaries after publish so prepack never
packs them into the npm tarball; they are rebuilt for the GitHub release.
# Conflicts:
#	.github/workflows/release.yml
@zeldrisho zeldrisho changed the title fix(release): hand release PR to a human instead of auto-merging fix(release): hand release PR to a human and ship the prebuilt npm bin Aug 8, 2026
- Guard the on_main path: the release tag's tree must equal HEAD^{tree},
  not merely be an ancestor, so the follow-up build/publish can never
  diverge from the tagged source.
- Pass real line breaks to gh pr create --body (printf) so the release
  message and merge instructions render as separate paragraphs.
- Treat NEUTRAL/STALE/SKIPPED/STARTUP_FAILURE/TIMED_OUT/ACTION_REQUIRED
  CI conclusions as terminal failures instead of polling until timeout.
- Anchor GitHub release notes to the exact "## [version]" changelog
  heading and fail closed when the section is missing.
@zeldrisho
zeldrisho merged commit 1635ae2 into main Aug 8, 2026
5 checks passed
@zeldrisho
zeldrisho deleted the fix/release-human-merge branch August 8, 2026 12:32
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