Skip to content

fix: run postrelease scripts with npm - #51

Merged
Kikobeats merged 1 commit into
masterfrom
Kikobeats/fix-pnpm-ignored-builds-08294e6b
Sep 8, 2026
Merged

Kikobeats merged 1 commit into
masterfrom
Kikobeats/fix-pnpm-ignored-builds-08294e6b

Conversation

@Kikobeats

@Kikobeats Kikobeats commented Sep 8, 2026

Copy link
Copy Markdown
Member

What broke

Run 34081791051 failed at the release step:

Error: ERR_PNPM_IGNORED_BUILDS
  × installing dependencies
  ╰─▶ Ignored build scripts: simple-git-hooks@2.14.0, spawn-sync@1.0.15

The --dangerously-allow-all-builds flag on the Install step is not the problem. The failure came from a second install nobody asked for: standard-version rewrites package.json, then postrelease runs pnpm release:tags, and pnpm's verify-deps-before-run reinstalls before running the script. That implicit install carries no flag, so it aborts.

The flag cannot reach it either: pnpm --dangerously-allow-all-builds release:tags fails the same way, because pnpm passes the flag on to the script rather than to its own install.

What changed

postrelease runs its scripts with npm run instead of pnpm. npm does not reinstall before running a script, so the implicit install disappears. Workflows are untouched and the flag keeps doing its job on the install step.

How it was tested

Against pnpm 12.3.4, what CI resolves version: latest to. Install with the flag, bump the package.json version the way standard-version does, then run the release script:

### old postrelease (pnpm release:tags), after version bump:
Error: ERR_PNPM_IGNORED_BUILDS
  ╰─▶ Ignored build scripts: simple-git-hooks@2.14.0, spawn-sync@1.0.15
### new postrelease (npm run release:tags):
Everything up-to-date

(--dry-run appended to the push, so nothing was written.)

npm test (lint + ava): 1035 tests passed, coverage unchanged at 96.7%.

Outcome

The release job reaches npm publish instead of exiting 1. The repo is stuck at v1.4.16 with v1.4.17 aborted mid-flight; this unblocks it.


Note

Medium Risk
Touches the release/publish script chain only, but a mistake here could block or mis-run tagging and npm publish.

Overview
The postrelease hook now invokes release:tags and release:github with npm run instead of pnpm, so those steps are not executed under pnpm’s script runner.

That avoids pnpm 12’s verify-deps-before-run path (triggered after standard-version rewrites package.json) from doing an implicit install that rejects ignored dependency build scripts and fails the release job.

Reviewed by Cursor Bugbot for commit 54705b7. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 842ca726-d858-4b0f-a90f-0a165ac7c764

📥 Commits

Reviewing files that changed from the base of the PR and between 6515de4 and 4a029f8.

📒 Files selected for processing (5)
  • .github/workflows/cron.yml
  • .github/workflows/main.yml
  • .github/workflows/pull_request.yml
  • .gitignore
  • pnpm-workspace.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The repository now restricts dependency build scripts during pnpm installation. It permits simple-git-hooks, blocks spawn-sync, removes the broad install flag from CI workflows, and ignores pnpm-lock.yaml.

Changes

pnpm build controls

Layer / File(s) Summary
Dependency build policy
pnpm-workspace.yaml, .gitignore
pnpm permits builds for simple-git-hooks, blocks builds for spawn-sync, and excludes pnpm-lock.yaml from version control.
CI installation enforcement
.github/workflows/cron.yml, .github/workflows/main.yml, .github/workflows/pull_request.yml
CI installation commands no longer use --dangerously-allow-all-builds.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 4a029

Dependency installs now use an explicit restricted build-script policy across CI, allowing the required hook dependency while blocking spawn-sync. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title is misleading. The changes configure pnpm build-script permissions and remove the dangerous install flag; they do not make postrelease scripts run with npm. Rename the pull request to describe the pnpm build-script configuration and workflow changes, such as "fix: configure pnpm build scripts for releases".
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Kikobeats/fix-pnpm-ignored-builds-08294e6b

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Kikobeats
Kikobeats force-pushed the Kikobeats/fix-pnpm-ignored-builds-08294e6b branch from 4a029f8 to a12fd2d Compare September 8, 2026 06:35
@Kikobeats Kikobeats changed the title ci: declare allowed build scripts for pnpm ci: allow dependency build scripts Sep 8, 2026
@Kikobeats
Kikobeats force-pushed the Kikobeats/fix-pnpm-ignored-builds-08294e6b branch from a12fd2d to 71128c6 Compare September 8, 2026 06:37
@Kikobeats Kikobeats changed the title ci: allow dependency build scripts ci: allow dependency build scripts during release Sep 8, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 71128c6. Configure here.

Comment thread .github/workflows/main.yml Outdated
The release job failed with ERR_PNPM_IGNORED_BUILDS. The
`--dangerously-allow-all-builds` flag on the install step is fine; the
failure came from an install nobody asked for. `standard-version`
rewrites package.json, then `pnpm release:tags` runs, and pnpm's
verify-deps-before-run reinstalls first. That implicit install carries no
flag and aborts on simple-git-hooks and spawn-sync.

npm runs the script without reinstalling, so the flag keeps doing its job
on the install step and nothing else changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Kikobeats
Kikobeats force-pushed the Kikobeats/fix-pnpm-ignored-builds-08294e6b branch from 71128c6 to 54705b7 Compare September 8, 2026 06:48
@Kikobeats Kikobeats changed the title ci: allow dependency build scripts during release fix: run postrelease scripts with npm Sep 8, 2026
@Kikobeats
Kikobeats merged commit 1849c45 into master Sep 8, 2026
4 checks passed
@Kikobeats
Kikobeats deleted the Kikobeats/fix-pnpm-ignored-builds-08294e6b branch September 8, 2026 06:51
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