Skip to content

ci: fix permissions #11

ci: fix permissions

ci: fix permissions #11

Workflow file for this run

name: publish
on:
push:
tags:
- v*
permissions:
contents: read
jobs:
publish-npm:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0 # Important for changelog
filter: blob:none # We don't need all blobs
- run: corepack enable
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: .node-version
registry-url: https://registry.npmjs.org/
- run: pnpm install
- run: echo VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_ENV
- run: pnpm version ${VERSION}
- name: Generate changelog with git-cliff
uses: tj-actions/git-cliff@b8b856ab6829a813d4ed58476b6faaec9c2b24ef # v1.4.2
with:
args: --latest --strip all
output: 'CHANGELOG.md'
- run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
with:
bodyFile: 'CHANGELOG.md'
name: ${{ env.VERSION }}
prerelease: ${{ contains(github.ref_name, '-') }}