Update npm-publish.yml with permissions (#45) #22
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
| # Release workflow powered by semantic-release. | |
| # Only publishes when conventional commits since last release warrant a release. | |
| name: Release | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Enable Corepack (Yarn 4) | |
| run: corepack enable | |
| - run: yarn install --immutable | |
| - run: yarn tsc | |
| - run: yarn build | |
| - name: Run semantic-release | |
| run: yarn release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |