Skip to content

Commit a765879

Browse files
committed
use github_token instead of PAT
1 parent bc0da1e commit a765879

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,28 @@ on:
1313
jobs:
1414
ci:
1515
runs-on: ubuntu-latest
16+
permissions:
17+
id-token: write
18+
contents: write
19+
pull-requests: write
1620
if: |
1721
github.event.pull_request.head.repo.full_name == github.repository ||
1822
(github.ref == 'refs/heads/master' && github.event_name == 'push')
1923
steps:
2024
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3.0.0
2125
with:
22-
token: '${{ secrets.BOT_TOKEN }}'
26+
token: '${{ secrets.GITHUB_TOKEN }}'
27+
fetch-depth: 0
28+
29+
- name: Setup Node.js and Authenticate with npm
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
registry-url: 'https://registry.npmjs.org'
2334

2435
- name: Build packages
2536
uses: ./.github/actions/build
2637

27-
- name: prepare npm access
28-
run: echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}' >> ~/.npmrc
29-
# https://github.com/lerna/lerna/issues/2788 --no-verify-access
30-
# https://github.com/lerna/lerna/issues/1893 --preid ${{ github.sha }}
3138
- name: prerelease
3239
if: |
3340
!contains(github.head_ref, 'dependabot') &&
@@ -36,6 +43,7 @@ jobs:
3643
yarn release:canary \
3744
--yes --no-verify-access \
3845
--dist-tag '${{ github.event.pull_request.head.sha }}' --preid '${{ github.event.pull_request.head.sha }}' \
46+
--npm-publish-args="--provenance" \
3947
| tee __publish-log.txt
4048
4149
- name: Comment on PR
@@ -49,9 +57,9 @@ jobs:
4957
github.event_name == 'push' &&
5058
github.ref == 'refs/heads/master'
5159
env:
52-
GH_TOKEN: '${{ secrets.BOT_TOKEN }}'
60+
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
5361
run: |
5462
git config user.name "GitHub Actions Build"
5563
git config user.email "[email protected]"
5664
yarn release:check
57-
yarn release:latest --yes --no-verify-access
65+
yarn release:latest --yes --no-verify-access --npm-publish-args="--provenance"

0 commit comments

Comments
 (0)