Skip to content

Commit 94ec5cf

Browse files
committed
fix: setup provenance
1 parent 4dc6c2c commit 94ec5cf

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/main.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- beta
99
- main
1010

11+
permissions:
12+
contents: read # for checkout
13+
1114
jobs:
1215
test:
1316
runs-on: ${{ matrix.platform }}
@@ -31,6 +34,11 @@ jobs:
3134
- run: pnpm lint
3235

3336
release:
37+
permissions:
38+
contents: write # to be able to publish a GitHub release
39+
issues: write # to be able to comment on released issues
40+
pull-requests: write # to be able to comment on released pull requests
41+
id-token: write # to enable use of OIDC for npm provenance
3442
name: 'Semantic release'
3543
needs: test
3644
runs-on: ubuntu-latest
@@ -51,10 +59,15 @@ jobs:
5159
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5260
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
5361
# Build docs
54-
- run: npm run docs:build
62+
- run: pnpm docs:build
63+
- uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1
64+
id: generate-token
65+
with:
66+
app_id: ${{ secrets.ECOSCRIPT_APP_ID }}
67+
private_key: ${{ secrets.ECOSCRIPT_APP_PRIVATE_KEY }}
5568
# Deploy docs
5669
- uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3
5770
if: ${{ github.ref == 'refs/heads/main' }}
5871
with:
59-
github_token: ${{ secrets.GITHUB_TOKEN }}
72+
github_token: ${{ steps.generate-token.outputs.token }}
6073
publish_dir: ./docs

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
"node": "^14.13.1 || >=16.0.0"
146146
},
147147
"publishConfig": {
148-
"access": "public"
148+
"access": "public",
149+
"provenance": true
149150
}
150151
}

0 commit comments

Comments
 (0)