Skip to content

Commit ce10c18

Browse files
killaguclaude
andcommitted
feat(ci): use npm trusted publishing with OIDC authentication
Switch from static npm tokens to OIDC-based trusted publishing. npm CLI auto-detects OIDC environment and uses short-lived tokens, eliminating the need for NODE_AUTH_TOKEN secret. Provenance attestation is automatically generated. Add --access public for new scoped packages. Requires configuring trusted publisher on npmjs.com for each package. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1424058 commit ce10c18

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ jobs:
116116
echo "🧪 Running publish in dry-run mode..."
117117
if [[ "${{ github.event.inputs.version_type }}" == pre* ]]; then
118118
echo "Setting npm tag to: ${{ github.event.inputs.prerelease_tag }}"
119-
pnpm -r publish --dry-run --no-git-checks --tag=${{ github.event.inputs.prerelease_tag }}
119+
pnpm -r publish --dry-run --no-git-checks --access public --tag=${{ github.event.inputs.prerelease_tag }}
120120
else
121121
echo "Setting npm tag to: latest"
122-
pnpm -r publish --dry-run --no-git-checks --tag=latest
122+
pnpm -r publish --dry-run --no-git-checks --access public --tag=latest
123123
fi
124124
125125
- name: Publish packages
@@ -128,10 +128,10 @@ jobs:
128128
echo "📦 Publishing packages..."
129129
if [[ "${{ github.event.inputs.version_type }}" == pre* ]]; then
130130
echo "Setting npm tag to: ${{ github.event.inputs.prerelease_tag }}"
131-
pnpm -r publish --no-git-checks --tag=${{ github.event.inputs.prerelease_tag }}
131+
NPM_CONFIG_LOGLEVEL=verbose pnpm -r publish --no-git-checks --access public --provenance --tag=${{ github.event.inputs.prerelease_tag }} || tail -n 100 ~/.npm/_logs/*.log && exit 1
132132
else
133133
echo "Setting npm tag to: latest"
134-
pnpm -r publish --no-git-checks --tag=latest
134+
NPM_CONFIG_LOGLEVEL=verbose pnpm -r publish --no-git-checks --access public --provenance --tag=latest || tail -n 100 ~/.npm/_logs/*.log || tail -n 100 ~/.npm/_logs/*.log && exit 1
135135
fi
136136
137137
- name: Create GitHub Release (draft)

0 commit comments

Comments
 (0)