fix: add permissions for npm publishing in workflows #43
Workflow file for this run
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 ngx-cookie-service-ssr to NPM | |
| on: | |
| push: | |
| ### Publish on new tag release | |
| tags: | |
| - v* | |
| permissions: | |
| id-token: write # Required for npm trusted publishing (OIDC) | |
| contents: write # Required for semantic-release to push tags/commits | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: latest | |
| - name: Install Dependencies | |
| run: pnpm i --no-frozen-lockfile | |
| - name: Build project | |
| run: pnpm build:ngx-cookie-service-ssr | |
| - name: Publish to NPM registry | |
| uses: JS-DevTools/npm-publish@v3 | |
| with: | |
| token: ${{ secrets.NPM_TOKEN }} | |
| package: dist/ngx-cookie-service-ssr/package.json | |
| access: public |