Skip to content

Commit e1338e8

Browse files
committed
chore: upgrade setup-node to v7
1 parent 5e0bcaf commit e1338e8

6 files changed

Lines changed: 19 additions & 26 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
persist-credentials: false
2929
- name: Set up Node.js 24
30-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
30+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
3131
with:
3232
node-version: 24.x
3333
cache: npm
@@ -75,7 +75,7 @@ jobs:
7575
fetch-depth: 0
7676
persist-credentials: false
7777
- name: Set up Node.js ${{ matrix.node-version }}
78-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
78+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
7979
with:
8080
node-version: ${{ matrix.node-version }}
8181
cache: npm
@@ -112,7 +112,7 @@ jobs:
112112
with:
113113
persist-credentials: false
114114
- name: Set up Node.js 22
115-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
115+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
116116
with:
117117
node-version: 22.x
118118
cache: npm
@@ -134,7 +134,7 @@ jobs:
134134
with:
135135
persist-credentials: false
136136
- name: Set up Node.js 24
137-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
137+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
138138
with:
139139
node-version: 24.x
140140
cache: npm
@@ -154,7 +154,7 @@ jobs:
154154
with:
155155
persist-credentials: false
156156
- name: Set up Node.js 26
157-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
157+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
158158
with:
159159
node-version: 26.x
160160
cache: npm
@@ -181,7 +181,7 @@ jobs:
181181
with:
182182
persist-credentials: false
183183
- name: Set up Node.js 24
184-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
184+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
185185
with:
186186
node-version: 24.x
187187
cache: npm

.github/workflows/live-smoke.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
persist-credentials: false
3131
- name: Set up Node.js 24
32-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
32+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
3333
with:
3434
node-version: 24.x
3535
cache: npm

.github/workflows/publish.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
8383
echo "release-commit=${release_commit}" >> "$GITHUB_OUTPUT"
8484
- name: Set up Node.js 24
85-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
85+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
8686
with:
8787
node-version: 24.x
8888
cache: npm
@@ -163,7 +163,7 @@ jobs:
163163
persist-credentials: false
164164
ref: ${{ needs.verify.outputs.release-commit }}
165165
- name: Set up Node.js 24
166-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
166+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
167167
with:
168168
node-version: 24.x
169169
cache: npm
@@ -204,9 +204,10 @@ jobs:
204204
persist-credentials: false
205205
ref: ${{ needs.verify.outputs.release-commit }}
206206
- name: Set up Node.js 24
207-
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
207+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
208208
with:
209209
node-version: 24.x
210+
package-manager-cache: false
210211
registry-url: https://registry.npmjs.org
211212
- name: Use a Trusted Publishing-capable npm CLI
212213
run: npm install --global npm@11.12.1

scripts/publish-artifact.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ set -euo pipefail
77

88
artifact_directory="${ARTIFACT_DIRECTORY:-release-artifacts}"
99

10-
# actions/setup-node exports this fixed sentinel when registry-url is configured,
11-
# including the npm-documented Trusted Publishing workflow.
12-
setup_node_auth_placeholder="XXXXX-XXXXX-XXXXX-XXXXX"
13-
if [[ -n "${NPM_TOKEN:-}" ]] || \
14-
[[ -n "${NODE_AUTH_TOKEN:-}" && "${NODE_AUTH_TOKEN}" != "$setup_node_auth_placeholder" ]]; then
10+
if [[ -n "${NPM_TOKEN:-}" ]] || [[ -n "${NODE_AUTH_TOKEN:-}" ]]; then
1511
echo "Registry tokens are forbidden; publication must use npm Trusted Publishing." >&2
1612
exit 1
1713
fi

tests/publish-artifact.test.mjs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { afterEach, describe, expect, it } from "vitest";
1818
const script = fileURLToPath(
1919
new URL("../scripts/publish-artifact.sh", import.meta.url),
2020
);
21-
const setupNodeAuthPlaceholder = "XXXXX-XXXXX-XXXXX-XXXXX";
2221
const temporaryDirectories = [];
2322

2423
afterEach(() => {
@@ -97,17 +96,11 @@ describe("publish artifact authentication", () => {
9796
);
9897
});
9998

100-
it("allows the actions/setup-node authentication placeholder", () => {
101-
const { log, result } = runPublish({
102-
nodeAuthToken: setupNodeAuthPlaceholder,
103-
});
104-
expect(result.status, result.stderr).toBe(0);
105-
expect(log).toMatch(
106-
/^token-present\npublish .* --provenance --tag next\n$/,
107-
);
108-
});
109-
11099
it.each([
100+
[
101+
"NODE_AUTH_TOKEN setup-node sentinel",
102+
{ nodeAuthToken: "XXXXX-XXXXX-XXXXX-XXXXX" },
103+
],
111104
["NODE_AUTH_TOKEN", { nodeAuthToken: "opaque" }],
112105
["NPM_TOKEN", { npmToken: "opaque" }],
113106
])("rejects the %s registry credential", (_name, options) => {

tests/workflow-contract.test.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ describe("GitHub Actions workflow contract", () => {
116116
expect(publishWorkflow).not.toContain("NPM_ALPHA1_BOOTSTRAP");
117117
expect(publishWorkflow).not.toContain("recover-verify");
118118
expect(publishWorkflow).not.toContain("recover-publish");
119+
expect(publish).toMatch(
120+
/package-manager-cache: false\n {10}registry-url: https:\/\/registry\.npmjs\.org/,
121+
);
119122
});
120123

121124
it("pins third-party actions and disables checkout credential persistence", () => {

0 commit comments

Comments
 (0)