Skip to content

Commit e011581

Browse files
DavertMikclaude
andcommitted
fix(publish): use OIDC and ignore-scripts env var for npm publish
- Strip 'v' prefix from release tag when setting version - Use npm_config_ignore_scripts env var to skip prepare script (known npm bug where --ignore-scripts flag doesn't work) - Always publish to 'beta' tag for prerelease workflow - Change permissions from contents:write to contents:read Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9b9ba8b commit e011581

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/publish-beta.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [published]
66

77
permissions:
8-
contents: write
8+
contents: read
99
id-token: write
1010

1111
jobs:
@@ -24,7 +24,12 @@ jobs:
2424
node-version: '20.x'
2525

2626
- name: Set package version
27-
run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version
27+
run: |
28+
TAG="${{ github.event.release.tag_name }}"
29+
VERSION="${TAG#v}"
30+
npm version "$VERSION" --no-git-tag-version
2831
2932
- name: Publish to npm
30-
run: npm publish --provenance --access public --tag beta --ignore-scripts
33+
run: npm publish --provenance --access public --tag beta
34+
env:
35+
npm_config_ignore_scripts: true

0 commit comments

Comments
 (0)