Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b9b25d4

Browse filesBrowse files
Remove always-auth configuration handling from action (#1436)
* Remove always-auth configuration handling from setup-node * docs: update README to note always-auth removal Update README to mention removal of always-auth input * Clarify removal of 'always-auth' input in README Updated the description of the 'always-auth' input removal for clarity.
1 parent 633bb92 commit b9b25d4
Copy full SHA for b9b25d4

File tree

Expand file treeCollapse file tree

11 files changed

+34
-85
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

11 files changed

+34
-85
lines changed
Open diff view settings
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+3-5Lines changed: 3 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This action provides the following functionality for GitHub Actions users:
1616

1717
- Caching is now automatically enabled for npm projects when either the `devEngines.packageManager` field or the top-level `packageManager` field in `package.json` is set to `npm`. For other package managers, such as Yarn and pnpm, caching is disabled by default and must be configured manually using the `cache` input.
1818

19+
- The `always-auth` input has been removed, as it is deprecated and will no longer be supported in future npm releases. To ensure your workflows continue to run without warnings or errors, please remove any references to `always-auth` from your configuration.
20+
1921
## Breaking changes in V5
2022

2123
- Enabled caching by default with package manager detection if no cache input is provided.
@@ -92,10 +94,6 @@ See [action.yml](action.yml)
9294
# Default: ''
9395
scope: ''
9496

95-
# Set always-auth option in npmrc file.
96-
# Default: ''
97-
always-auth: ''
98-
9997
# Optional mirror to download binaries from.
10098
# Artifacts need to match the official Node.js
10199
# Example:
@@ -271,4 +269,4 @@ Contributions are welcome! See [Contributor's Guide](docs/contributors.md)
271269

272270
## Code of Conduct
273271

274-
:wave: Be nice. See [our code of conduct](CODE_OF_CONDUCT.md)
272+
:wave: Be nice. See [our code of conduct](CODE_OF_CONDUCT.md)
Collapse file

‎__tests__/authutil.test.ts‎

Copy file name to clipboardExpand all lines: __tests__/authutil.test.ts
+21-34Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -76,115 +76,102 @@ describe('authutil tests', () => {
7676
}
7777

7878
it('Sets up npmrc for npmjs', async () => {
79-
await auth.configAuthentication('https://registry.npmjs.org/', 'false');
79+
await auth.configAuthentication('https://registry.npmjs.org/');
8080

8181
expect(fs.statSync(rcFile)).toBeDefined();
8282
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
8383
const rc = readRcFile(rcFile);
8484
expect(rc['registry']).toBe('https://registry.npmjs.org/');
85-
expect(rc['always-auth']).toBe('false');
8685
});
8786

8887
it('Appends trailing slash to registry', async () => {
89-
await auth.configAuthentication('https://registry.npmjs.org', 'false');
88+
await auth.configAuthentication('https://registry.npmjs.org');
9089

9190
expect(fs.statSync(rcFile)).toBeDefined();
9291
const rc = readRcFile(rcFile);
9392
expect(rc['registry']).toBe('https://registry.npmjs.org/');
94-
expect(rc['always-auth']).toBe('false');
9593
});
9694

9795
it('Configures scoped npm registries', async () => {
9896
process.env['INPUT_SCOPE'] = 'myScope';
99-
await auth.configAuthentication('https://registry.npmjs.org', 'false');
97+
await auth.configAuthentication('https://registry.npmjs.org');
10098

10199
expect(fs.statSync(rcFile)).toBeDefined();
102100
const rc = readRcFile(rcFile);
103101
expect(rc['@myscope:registry']).toBe('https://registry.npmjs.org/');
104-
expect(rc['always-auth']).toBe('false');
105102
});
106103

107104
it('Automatically configures GPR scope', async () => {
108-
await auth.configAuthentication('npm.pkg.github.com', 'false');
105+
await auth.configAuthentication('npm.pkg.github.com');
109106

110107
expect(fs.statSync(rcFile)).toBeDefined();
111108
const rc = readRcFile(rcFile);
112109
expect(rc['@ownername:registry']).toBe('npm.pkg.github.com/');
113-
expect(rc['always-auth']).toBe('false');
114-
});
115-
116-
it('Sets up npmrc for always-auth true', async () => {
117-
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
118-
expect(fs.statSync(rcFile)).toBeDefined();
119-
const rc = readRcFile(rcFile);
120-
expect(rc['registry']).toBe('https://registry.npmjs.org/');
121-
expect(rc['always-auth']).toBe('true');
122110
});
123111

124112
it('is already set the NODE_AUTH_TOKEN export it', async () => {
125113
process.env.NODE_AUTH_TOKEN = 'foobar';
126-
await auth.configAuthentication('npm.pkg.github.com', 'false');
114+
await auth.configAuthentication('npm.pkg.github.com');
127115
expect(fs.statSync(rcFile)).toBeDefined();
128116
const rc = readRcFile(rcFile);
129117
expect(rc['@ownername:registry']).toBe('npm.pkg.github.com/');
130-
expect(rc['always-auth']).toBe('false');
131118
expect(process.env.NODE_AUTH_TOKEN).toEqual('foobar');
132119
});
133120

134121
it('configAuthentication should overwrite non-scoped with non-scoped', async () => {
135122
fs.writeFileSync(rcFile, 'registry=NNN');
136-
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
123+
await auth.configAuthentication('https://registry.npmjs.org/');
137124
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
138125
expect(contents).toBe(
139-
`//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
126+
`//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/`
140127
);
141128
});
142129

143130
it('configAuthentication should overwrite only non-scoped', async () => {
144131
fs.writeFileSync(rcFile, `registry=NNN${os.EOL}@myscope:registry=MMM`);
145-
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
132+
await auth.configAuthentication('https://registry.npmjs.org/');
146133
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
147134
expect(contents).toBe(
148-
`@myscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
135+
`@myscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/`
149136
);
150137
});
151138

152139
it('configAuthentication should add non-scoped to scoped', async () => {
153140
fs.writeFileSync(rcFile, '@myscope:registry=NNN');
154-
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
141+
await auth.configAuthentication('https://registry.npmjs.org/');
155142
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
156143
expect(contents).toBe(
157-
`@myscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
144+
`@myscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/`
158145
);
159146
});
160147

161148
it('configAuthentication should overwrite scoped with scoped', async () => {
162149
process.env['INPUT_SCOPE'] = 'myscope';
163150
fs.writeFileSync(rcFile, `@myscope:registry=NNN`);
164-
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
151+
await auth.configAuthentication('https://registry.npmjs.org/');
165152
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
166153
expect(contents).toBe(
167-
`//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
154+
`//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
168155
);
169156
});
170157

171158
it('configAuthentication should overwrite only scoped', async () => {
172159
process.env['INPUT_SCOPE'] = 'myscope';
173160
fs.writeFileSync(rcFile, `registry=NNN${os.EOL}@myscope:registry=MMM`);
174-
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
161+
await auth.configAuthentication('https://registry.npmjs.org/');
175162
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
176163
expect(contents).toBe(
177-
`registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
164+
`registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
178165
);
179166
});
180167

181168
it('configAuthentication should add scoped to non-scoped', async () => {
182169
process.env['INPUT_SCOPE'] = 'myscope';
183170
fs.writeFileSync(rcFile, `registry=MMM`);
184-
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
171+
await auth.configAuthentication('https://registry.npmjs.org/');
185172
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
186173
expect(contents).toBe(
187-
`registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
174+
`registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
188175
);
189176
});
190177

@@ -194,20 +181,20 @@ describe('authutil tests', () => {
194181
rcFile,
195182
`@otherscope:registry=NNN${os.EOL}@myscope:registry=MMM`
196183
);
197-
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
184+
await auth.configAuthentication('https://registry.npmjs.org/');
198185
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
199186
expect(contents).toBe(
200-
`@otherscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
187+
`@otherscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
201188
);
202189
});
203190

204191
it('configAuthentication should add scoped to another scoped', async () => {
205192
process.env['INPUT_SCOPE'] = 'myscope';
206193
fs.writeFileSync(rcFile, `@otherscope:registry=MMM`);
207-
await auth.configAuthentication('https://registry.npmjs.org/', 'true');
194+
await auth.configAuthentication('https://registry.npmjs.org/');
208195
const contents = fs.readFileSync(rcFile, {encoding: 'utf8'});
209196
expect(contents).toBe(
210-
`@otherscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true`
197+
`@otherscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/`
211198
);
212199
});
213200
});
Collapse file

‎__tests__/canary-installer.test.ts‎

Copy file name to clipboardExpand all lines: __tests__/canary-installer.test.ts
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ describe('setup-node', () => {
227227
const versionSpec = '11.15.0';
228228

229229
inputs['node-version'] = versionSpec;
230-
inputs['always-auth'] = false;
231230
inputs['token'] = 'faketoken';
232231

233232
// ... but not in the local cache
@@ -283,7 +282,6 @@ describe('setup-node', () => {
283282
const versionSpec = '19.0.0-v8-canary';
284283

285284
inputs['node-version'] = versionSpec;
286-
inputs['always-auth'] = false;
287285
inputs['token'] = 'faketoken';
288286

289287
findSpy.mockImplementation(() => '');
@@ -324,7 +322,6 @@ describe('setup-node', () => {
324322

325323
inputs['node-version'] = version;
326324
inputs['architecture'] = arch;
327-
inputs['always-auth'] = false;
328325
inputs['token'] = 'faketoken';
329326

330327
const expectedUrl = `https://nodejs.org/download/v8-canary/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
@@ -569,7 +566,6 @@ describe('setup-node', () => {
569566
const versionSpec = 'v20-v8-canary';
570567

571568
inputs['node-version'] = versionSpec;
572-
inputs['always-auth'] = false;
573569
inputs['token'] = 'faketoken';
574570

575571
os.platform = 'linux';
Collapse file

‎__tests__/nightly-installer.test.ts‎

Copy file name to clipboardExpand all lines: __tests__/nightly-installer.test.ts
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ describe('setup-node', () => {
255255
const versionSpec = '13.13.1-nightly20200415947ddec091';
256256

257257
inputs['node-version'] = versionSpec;
258-
inputs['always-auth'] = false;
259258
inputs['token'] = 'faketoken';
260259

261260
// ... but not in the local cache
@@ -291,7 +290,6 @@ describe('setup-node', () => {
291290
];
292291

293292
inputs['node-version'] = versionSpec;
294-
inputs['always-auth'] = false;
295293
inputs['token'] = 'faketoken';
296294

297295
// ... but not in the local cache
@@ -333,7 +331,6 @@ describe('setup-node', () => {
333331
];
334332

335333
inputs['node-version'] = versionSpec;
336-
inputs['always-auth'] = false;
337334
inputs['token'] = 'faketoken';
338335

339336
// ... but not in the local cache
@@ -389,7 +386,6 @@ describe('setup-node', () => {
389386
const versionSpec = '18.0.0-nightly202204180699150267';
390387

391388
inputs['node-version'] = versionSpec;
392-
inputs['always-auth'] = false;
393389
inputs['token'] = 'faketoken';
394390

395391
findSpy.mockImplementation(() => '');
@@ -427,7 +423,6 @@ describe('setup-node', () => {
427423

428424
inputs['node-version'] = version;
429425
inputs['architecture'] = arch;
430-
inputs['always-auth'] = false;
431426
inputs['token'] = 'faketoken';
432427

433428
const expectedUrl = `https://nodejs.org/download/nightly/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
@@ -473,7 +468,6 @@ describe('setup-node', () => {
473468

474469
inputs['node-version'] = version;
475470
inputs['architecture'] = arch;
476-
inputs['always-auth'] = false;
477471
inputs['token'] = 'faketoken';
478472
inputs['mirror'] = 'https://my-mirror.org';
479473
inputs['mirror-token'] = 'my-mirror-token';
Collapse file

‎__tests__/official-installer.test.ts‎

Copy file name to clipboardExpand all lines: __tests__/official-installer.test.ts
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ describe('setup-node', () => {
235235
const resolvedVersion = versionSpec;
236236

237237
inputs['node-version'] = versionSpec;
238-
inputs['always-auth'] = false;
239238
inputs['token'] = 'faketoken';
240239

241240
const expectedUrl =
@@ -290,7 +289,6 @@ describe('setup-node', () => {
290289
const versionSpec = '11.15.0';
291290
const mirror = 'https://my_mirror_url';
292291
inputs['node-version'] = versionSpec;
293-
inputs['always-auth'] = false;
294292
inputs['token'] = 'faketoken';
295293
inputs['mirror'] = mirror;
296294
inputs['mirror-token'] = 'faketoken';
@@ -327,7 +325,6 @@ describe('setup-node', () => {
327325
const versionSpec = '11.15.0';
328326

329327
inputs['node-version'] = versionSpec;
330-
inputs['always-auth'] = false;
331328
inputs['token'] = 'faketoken';
332329

333330
// ... but not in the local cache
@@ -385,7 +382,6 @@ describe('setup-node', () => {
385382
const resolvedVersion = versionSpec;
386383

387384
inputs['node-version'] = versionSpec;
388-
inputs['always-auth'] = false;
389385
inputs['token'] = 'faketoken';
390386

391387
findSpy.mockImplementation(() => '');
@@ -405,7 +401,6 @@ describe('setup-node', () => {
405401
const versionSpec = '11.15.0';
406402

407403
inputs['node-version'] = versionSpec;
408-
inputs['always-auth'] = false;
409404
inputs['token'] = 'faketoken';
410405

411406
// ... but not in the local cache
@@ -448,7 +443,6 @@ describe('setup-node', () => {
448443

449444
inputs['node-version'] = version;
450445
inputs['architecture'] = arch;
451-
inputs['always-auth'] = false;
452446
inputs['token'] = 'faketoken';
453447

454448
const expectedUrl =
@@ -560,7 +554,6 @@ describe('setup-node', () => {
560554

561555
inputs['node-version'] = versionSpec;
562556
inputs['check-latest'] = 'true';
563-
inputs['always-auth'] = false;
564557
inputs['token'] = 'faketoken';
565558

566559
// ... but not in the local cache
@@ -602,7 +595,6 @@ describe('setup-node', () => {
602595

603596
inputs['node-version'] = versionSpec;
604597
inputs['check-latest'] = 'true';
605-
inputs['always-auth'] = false;
606598
inputs['token'] = 'faketoken';
607599

608600
// ... but not in the local cache
@@ -882,7 +874,6 @@ describe('setup-node', () => {
882874

883875
inputs['node-version'] = version;
884876
inputs['architecture'] = arch;
885-
inputs['always-auth'] = false;
886877
inputs['token'] = 'faketoken';
887878
inputs['mirror'] = 'https://my_mirror_url';
888879
inputs['mirror-token'] = 'faketoken';
Collapse file

‎__tests__/rc-installer.test.ts‎

Copy file name to clipboardExpand all lines: __tests__/rc-installer.test.ts
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ describe('setup-node', () => {
194194
const versionSpec = '13.0.0-rc.0';
195195

196196
inputs['node-version'] = versionSpec;
197-
inputs['always-auth'] = false;
198197
inputs['token'] = 'faketoken';
199198

200199
// ... but not in the local cache
@@ -239,7 +238,6 @@ describe('setup-node', () => {
239238
const versionSpec = '14.7.0-rc.1';
240239

241240
inputs['node-version'] = versionSpec;
242-
inputs['always-auth'] = false;
243241
inputs['token'] = 'faketoken';
244242

245243
findSpy.mockImplementation(() => '');
@@ -268,7 +266,6 @@ describe('setup-node', () => {
268266

269267
inputs['node-version'] = version;
270268
inputs['architecture'] = arch;
271-
inputs['always-auth'] = false;
272269
inputs['token'] = 'faketoken';
273270

274271
const expectedUrl = `https://nodejs.org/download/rc/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`;
Collapse file

‎action.yml‎

Copy file name to clipboardExpand all lines: action.yml
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: 'Setup Node.js environment'
22
description: 'Setup a Node.js environment by adding problem matchers and optionally downloading and adding it to the PATH.'
33
author: 'GitHub'
44
inputs:
5-
always-auth:
6-
description: 'Set always-auth in npmrc.'
7-
default: 'false'
85
node-version:
96
description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.'
107
node-version-file:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.