Skip to content

Commit 72a8096

Browse files
aksOpsclaude
andcommitted
ci: skip prepublishOnly in release publish jobs
Both publish-npm and publish-gpr download the prebuilt dist artifact from the upstream build job, so the prepublishOnly hook (which calls pnpm typecheck + build) is redundant — and pnpm isn't installed in those jobs, so it fails with "pnpm: not found". Add --ignore-scripts to skip the hook in CI; local `npm publish` still benefits from it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 06c5e23 commit 72a8096

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ jobs:
8888
scope: "@ossrandom"
8989

9090
- name: Publish (with provenance)
91-
run: npm publish --provenance --access public
91+
# --ignore-scripts: build was already done in the `build` job;
92+
# the prepublishOnly hook would otherwise try to invoke pnpm,
93+
# which isn't installed in this job.
94+
run: npm publish --provenance --access public --ignore-scripts
9295
env:
9396
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9497

@@ -120,7 +123,8 @@ jobs:
120123
fs.writeFileSync('package.json', JSON.stringify(p, null, 2));
121124
"
122125
123-
- run: npm publish
126+
- name: Publish to GitHub Packages
127+
run: npm publish --ignore-scripts
124128
env:
125129
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126130

0 commit comments

Comments
 (0)