fix publish: use OIDC trusted publishing without token per npm docs #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to npm | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: publish | |
| cancel-in-progress: true | |
| jobs: | |
| publish: | |
| if: "contains(github.event.head_commit.message, '[skip ci]') == false" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Bump patch version | |
| run: 'npm version patch -m "bump to %s [skip ci]"' | |
| - name: Push version bump | |
| run: git push | |
| - name: Publish to npm | |
| run: npm publish --access public |