Skip to content

Commit 8051b48

Browse files
committed
chore: use trusted publishing
1 parent a2c46a0 commit 8051b48

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
# Go
2222
steps:
2323
- name: Check out repo
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v6
2525

2626
- name: Set up Node.js
27-
uses: actions/setup-node@v3
27+
uses: actions/setup-node@v6
2828
with:
2929
node-version: ${{ matrix.node-version }}
3030

@@ -48,7 +48,7 @@ jobs:
4848
- name: Notify
4949
uses: sarisia/actions-status-discord@v1
5050
# Only fire alert once
51-
if: github.ref == 'refs/heads/main' && failure() && matrix.node-version == '14.x' && matrix.os == 'ubuntu-latest'
51+
if: github.ref == 'refs/heads/main' && failure() && matrix.node-version == '24.x' && matrix.os == 'ubuntu-latest'
5252
with:
5353
webhook: ${{ secrets.DISCORD_WEBHOOK }}
5454
title: "build and test"
@@ -60,19 +60,22 @@ jobs:
6060
# Publish to package registries
6161
publish:
6262
# Setup
63+
permissions:
64+
id-token: write # Required for OIDC
65+
contents: read
6366
needs: build
6467
if: startsWith(github.ref, 'refs/tags/v')
6568
runs-on: ubuntu-latest
6669

6770
# Go
6871
steps:
6972
- name: Check out repo
70-
uses: actions/checkout@v3
73+
uses: actions/checkout@v6
7174

7275
- name: Set up Node.js
73-
uses: actions/setup-node@v3
76+
uses: actions/setup-node@v6
7477
with:
75-
node-version: lts/*
78+
node-version: 24.x
7679
registry-url: https://registry.npmjs.org/
7780

7881
# - name: Install
@@ -82,20 +85,16 @@ jobs:
8285
- name: Publish @RC to npm
8386
if: contains(github.ref, 'RC')
8487
run: npm publish --tag RC
85-
env:
86-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8788

8889
- name: Publish @latest to npm
8990
if: contains(github.ref, 'RC') == false #'!contains()'' doesn't work lol
9091
run: npm publish
91-
env:
92-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9392

9493
# Set up Node again, this time using GitHub as the publish target
9594
- name: Set up Node.js
96-
uses: actions/setup-node@v3
95+
uses: actions/setup-node@v6
9796
with:
98-
node-version: lts/*
97+
node-version: 24.x
9998
registry-url: https://npm.pkg.github.com/
10099

101100
- name: Notify

0 commit comments

Comments
 (0)