Skip to content

Commit

Permalink
chore(ci): fix publish access with correct permissions (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamzeh authored Apr 21, 2023
2 parents d5502c0 + 2661f5a commit 8de70cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -59,6 +62,9 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [build, test]
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v3
Expand All @@ -76,14 +82,16 @@ jobs:
run: npm ci

- name: Publish to npm
run: npm publish --provenance
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

create-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: publish
permissions:
contents: write

steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"node": ">=14.17.0"
},
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
}
}

0 comments on commit 8de70cc

Please sign in to comment.