Skip to content

Commit

Permalink
match NPM_TOKEN's environment variable name to official documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR committed Feb 26, 2023
1 parent a0e12bd commit bfe9b96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .changeset/brave-buckets-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@changesets/action": major
---

use `NODE_AUTH_TOKEN` as the environment variable name for the `NPM_TOKEN` secret

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].
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ const getOptionalInput = (name: string) => core.getInput(name) || undefined;
);
fs.appendFileSync(
userNpmrcPath,
`\n//registry.npmjs.org/:_authToken=\$\{NPM_TOKEN\}\n`
`\n//registry.npmjs.org/:_authToken=\$\{NODE_AUTH_TOKEN\}\n`
);
}
} else {
console.log("No user .npmrc file found, creating one");
fs.writeFileSync(
userNpmrcPath,
`//registry.npmjs.org/:_authToken=\$\{NPM_TOKEN\}\n`
`//registry.npmjs.org/:_authToken=\$\{NODE_AUTH_TOKEN\}\n`
);
}

Expand Down

0 comments on commit bfe9b96

Please sign in to comment.