Skip to content

Commit d5b7792

Browse files
Copilotkentcdodds
andauthored
chore: modernize GitHub Actions workflow for npm trusted publishers (#244)
* Initial plan * chore: update GitHub Actions workflow to use trusted publishers - Upgrade actions/checkout from v2 to v5 - Upgrade actions/setup-node from v2 to v6 - Update node matrix to [lts/-1, lts/*, latest] - Update release node to lts/* - Upgrade semantic-release-action from v2 to v5.0.2 - Update semantic_version from 17 to 25 - Remove NPM_TOKEN (using OIDC for npm provenance) - Add explicit permissions to release job Co-authored-by: kentcdodds <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: kentcdodds <[email protected]>
1 parent dd67e8d commit d5b7792

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

.github/workflows/validate.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121
if: ${{ !contains(github.head_ref, 'all-contributors') }}
2222
strategy:
2323
matrix:
24-
node: [18, 20]
24+
node: [lts/-1, lts/*, latest]
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: ⬇️ Checkout repo
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v5
2929

3030
- name: ⎔ Setup node
31-
uses: actions/setup-node@v2
31+
uses: actions/setup-node@v6
3232
with:
3333
node-version: ${{ matrix.node }}
3434

@@ -52,14 +52,19 @@ jobs:
5252
${{ github.repository == 'kentcdodds/mdx-bundler' &&
5353
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha',
5454
github.ref) && github.event_name == 'push' }}
55+
permissions:
56+
contents: write # to be able to publish a GitHub release
57+
id-token: write # to enable use of OIDC for npm provenance
58+
issues: write # to be able to comment on released issues
59+
pull-requests: write # to be able to comment on released pull requests
5560
steps:
5661
- name: ⬇️ Checkout repo
57-
uses: actions/checkout@v2
62+
uses: actions/checkout@v5
5863

5964
- name: ⎔ Setup node
60-
uses: actions/setup-node@v2
65+
uses: actions/setup-node@v6
6166
with:
62-
node-version: 20
67+
node-version: lts/*
6368

6469
- name: 📥 Download deps
6570
uses: bahmutov/npm-install@v1
@@ -72,9 +77,9 @@ jobs:
7277
run: npm run build
7378

7479
- name: 🚀 Release
75-
uses: cycjimmy/semantic-release-action@v2
80+
uses: cycjimmy/semantic-release-action@v5.0.2
7681
with:
77-
semantic_version: 17
82+
semantic_version: 25
7883
branches: |
7984
[
8085
'+([0-9])?(.{+([0-9]),x}).x',
@@ -86,4 +91,3 @@ jobs:
8691
]
8792
env:
8893
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)