Skip to content

Commit 316ce21

Browse files
committed
feat(trusted-publishing): refine the messages for related errors
now that the ordering of checks and fallbacks have been settled for #958
1 parent cf14bd9 commit 316ce21

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/definitions/errors.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,22 @@ Your configuration for the \`pkgRoot\` option is \`${pkgRoot}\`.`,
3737
export function ENONPMTOKEN({ registry }) {
3838
return {
3939
message: "No npm token specified.",
40-
details: `When not publishing through [trusted publishing](https://docs.npmjs.com/trusted-publishers) an [npm token](${linkify(
40+
details: `When not publishing through [trusted publishing](https://docs.npmjs.com/trusted-publishers), an [npm token](${linkify(
4141
"README.md#npm-registry-authentication"
4242
)}) must be created and set in the \`NPM_TOKEN\` environment variable on your CI environment.
4343
44-
Please make sure to create an [npm token](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) and to set it in the \`NPM_TOKEN\` environment variable on your CI environment. The token must allow to publish to the registry \`${registry}\`.`,
44+
Please make sure to create an [npm token](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) and set it in the \`NPM_TOKEN\` environment variable on your CI environment. The token must allow publishing to the registry \`${registry}\`.`,
4545
};
4646
}
4747

48-
export function EINVALIDNPMAUTH() {
48+
export function EINVALIDNPMAUTH({ registry }) {
4949
return {
5050
message: "Invalid npm authentication.",
5151
details: `The [authentication required to publish](${linkify(
5252
"README.md#npm-registry-authentication"
53-
)}) is not configured as needed.`,
53+
)}) configured in the \`NPM_TOKEN\` environment variable must be a valid [token](https://docs.npmjs.com/getting-started/working_with_tokens) allowed to publish to the registry \`${registry}\`.
54+
55+
Please make sure to set the \`NPM_TOKEN\` environment variable in your CI with the exact value of the npm token.`,
5456
};
5557
}
5658

0 commit comments

Comments
 (0)