Add write permissions to contents in release.yml #15
This file contains 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: Release | |
on: | |
push: | |
branches: | |
- main | |
workflow_call: | |
secrets: | |
NPM_TOKEN: | |
required: true | |
permissions: | |
contents: write | |
jobs: | |
release: | |
name: Release to NPM | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js Environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
- name: Install Dependencies | |
run: npm i | |
- name: Build Project | |
run: npm run build | |
- name: Run Test Suite | |
run: npm run test | |
- name: Semantic Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npx semantic-release | |
- name: Upload Code Coverage | |
uses: codecov/[email protected] |