Skip to content

Commit

Permalink
fix(manager:npm): wrong lockfile token replacement (#15229)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Apr 21, 2022
1 parent cf57025 commit 8267e77
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/modules/manager/npm/post-update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,17 +526,17 @@ export async function getAdditionalFiles(
NODE_ENV: 'dev',
};

let token = '';
let token: string | undefined;
try {
({ token = '' } = hostRules.find({
({ token } = hostRules.find({
hostType: config.platform,
url: 'https://api.github.com/',
}));
token += '@';
token = token ? `${token}@` : token;
} catch (err) {
logger.warn({ err }, 'Error getting token for packageFile');
}
const tokenRe = regEx(`${token}`, 'g', false);
const tokenRe = regEx(`${token ?? ''}`, 'g', false);
const localDir = GlobalConfig.get('localDir')!;
for (const npmLock of dirs.npmLockDirs) {
const lockFileDir = upath.dirname(npmLock);
Expand Down

0 comments on commit 8267e77

Please sign in to comment.