Skip to content

Commit

Permalink
feat: add npm provenance (#398)
Browse files Browse the repository at this point in the history
  • Loading branch information
khendrikse authored Apr 25, 2023
1 parent 1393df1 commit ba70428
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
jobs:
prerelease:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -37,7 +40,7 @@ jobs:
run: npm version ${{ steps.extract.outputs.version }}-${{ steps.extract.outputs.tag }}
- name: Push changes
run: git push --follow-tags
- name: Run npm publish
- name: Run npm publish --provenance
run: npm publish --tag=${{ steps.extract.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
6 changes: 5 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
jobs:
release-please:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
steps:
- uses: navikt/github-app-token-generator@a3831f44404199df32d8f39f7c0ad9bb8fa18b1c
id: get-token
Expand All @@ -28,7 +32,7 @@ jobs:
check-latest: true
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- run: npm publish
- run: npm publish --provenance
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"keywords": [],
"license": "MIT",
"repository": "netlify/functions",
"repository": "https://github.com/netlify/functions",
"bugs": {
"url": "https://github.com/netlify/functions/issues"
},
Expand Down

0 comments on commit ba70428

Please sign in to comment.