Skip to content

Commit

Permalink
fix: update package configuration to publish provenance data (#1652)
Browse files Browse the repository at this point in the history
* fix: update package configuration to publish provenance data

* Move signature audit and permission configuration to the correct job.
  • Loading branch information
arthurschreiber authored Aug 17, 2024
1 parent cf4c99b commit 8310c45
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ jobs:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest

permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance

steps:
- uses: actions/[email protected]

Expand All @@ -391,6 +397,9 @@ jobs:

- run: npm ci

- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures

- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- uses: actions/[email protected]

Expand All @@ -21,8 +16,6 @@ jobs:
with:
node-version: 18
cache: 'npm'
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Tag latest release
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"node": ">=18"
},
"publishConfig": {
"tag": "next"
"tag": "next",
"provenance": true
},
"dependencies": {
"@azure/core-auth": "^1.7.2",
Expand Down

0 comments on commit 8310c45

Please sign in to comment.