Skip to content

Commit bfe9b96

Browse files
committed
match NPM_TOKEN's environment variable name to official documentation
1 parent a0e12bd commit bfe9b96

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.changeset/brave-buckets-double.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@changesets/action": major
3+
---
4+
5+
use `NODE_AUTH_TOKEN` as the environment variable name for the `NPM_TOKEN` secret
6+
7+
This matches the official GitHub `setup-node` action (documentation)[https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry].

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
7373
);
7474
fs.appendFileSync(
7575
userNpmrcPath,
76-
`\n//registry.npmjs.org/:_authToken=\$\{NPM_TOKEN\}\n`
76+
`\n//registry.npmjs.org/:_authToken=\$\{NODE_AUTH_TOKEN\}\n`
7777
);
7878
}
7979
} else {
8080
console.log("No user .npmrc file found, creating one");
8181
fs.writeFileSync(
8282
userNpmrcPath,
83-
`//registry.npmjs.org/:_authToken=\$\{NPM_TOKEN\}\n`
83+
`//registry.npmjs.org/:_authToken=\$\{NODE_AUTH_TOKEN\}\n`
8484
);
8585
}
8686

0 commit comments

Comments
 (0)