Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit2432eb0

Browse files
committed
fix: always attempt to set the legacy token env var
Any npm command, include `npm version` attempts to exapand the `LEGACY_TOKEN` environment varialbe if it is set in `.npmrc`.
1 parente8fe729 commit2432eb0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎index.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ async function verifyConditions(pluginConfig, context) {
2323

2424
consterrors=verifyNpmConfig(pluginConfig);
2525

26+
setLegacyToken(context);
27+
2628
try{
2729
constpkg=awaitgetPkg(pluginConfig,context);
2830

2931
// Verify the npm authentication only if `npmPublish` is not false and `pkg.private` is not `true`
3032
if(pluginConfig.npmPublish!==false&&pkg.private!==true){
31-
setLegacyToken(context);
3233
awaitverifyNpmAuth(pluginConfig,pkg,context);
3334
}
3435
}catch(error){
@@ -44,11 +45,12 @@ async function prepare(pluginConfig, context) {
4445
letpkg;
4546
consterrors=verified ?[] :verifyNpmConfig(pluginConfig);
4647

48+
setLegacyToken(context);
49+
4750
try{
4851
// Reload package.json in case a previous external step updated it
4952
pkg=awaitgetPkg(pluginConfig,context);
5053
if(!verified&&pluginConfig.npmPublish!==false&&pkg.private!==true){
51-
setLegacyToken(context);
5254
awaitverifyNpmAuth(pluginConfig,pkg,context);
5355
}
5456
}catch(error){

‎test/integration.test.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ test('Skip npm auth verification if "package.private" is true', async t => {
6565
{npmPublish:false},
6666
{
6767
cwd,
68+
env:{},
6869
options:{publish:['@semantic-release/npm']},
6970
stdout:t.context.stdout,
7071
stderr:t.context.stderr,
@@ -83,6 +84,7 @@ test('Skip npm token verification if "package.private" is true', async t => {
8384
{},
8485
{
8586
cwd,
87+
env:{},
8688
options:{publish:['@semantic-release/npm']},
8789
stdout:t.context.stdout,
8890
stderr:t.context.stderr,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp