Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ jobs:
- name: Publish to npm
if: steps.npm-version.outputs.exists != 'true'
run: npm publish --access public --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: 'true'
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
Expand Down
5 changes: 3 additions & 2 deletions tests/publish-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ describe('release runtime contract', () => {
expect(ci).toContain('node-version: [24.18.0, 22.13.0]')
})

it('publishes through npm trusted publishing without a write token', () => {
it('publishes with the repository token and provenance', () => {
expect(publish).toContain('id-token: write')
expect(publish).toContain('node-version: 24.18.0')
expect(publish).toContain('registry-url: https://registry.npmjs.org')
expect(publish).toContain('package-manager-cache: false')
expect(publish).toContain('npm publish --access public --ignore-scripts')
expect(publish).not.toContain('NODE_AUTH_TOKEN')
expect(publish).toContain('NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}')
expect(publish).toContain("NPM_CONFIG_PROVENANCE: 'true'")
expect(publish).not.toContain('pnpm publish')
})
})