Skip to content

Commit

Permalink
fix(npm): datasource improvements (#9178)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Mar 17, 2021
1 parent 58daaab commit bca8931
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 172 deletions.
2 changes: 1 addition & 1 deletion lib/config/decrypt.ts
Expand Up @@ -48,7 +48,7 @@ export function decryptConfig(config: RenovateConfig): RenovateConfig {
{ decryptedToken: maskToken(token) },
'Migrating npmToken to npmrc'
);
if (decryptedConfig.npmrc) {
if (is.string(decryptedConfig.npmrc)) {
/* eslint-disable no-template-curly-in-string */
if (decryptedConfig.npmrc.includes('${NPM_TOKEN}')) {
logger.debug('Replacing ${NPM_TOKEN} with decrypted token');
Expand Down
33 changes: 0 additions & 33 deletions lib/datasource/npm/__snapshots__/get.spec.ts.snap
Expand Up @@ -7,7 +7,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -19,7 +18,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -31,7 +29,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -43,7 +40,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -55,7 +51,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -67,7 +62,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -79,7 +73,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -90,7 +83,6 @@ Array [
"headers": Object {
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"cache-control": "no-cache",
"host": "registry.npmjs.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -101,7 +93,6 @@ Array [
"headers": Object {
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"cache-control": "no-cache",
"host": "registry.npmjs.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -119,7 +110,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -137,7 +127,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -155,7 +144,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -174,7 +162,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -192,7 +179,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -210,7 +196,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -228,7 +213,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -246,7 +230,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -264,7 +247,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -282,7 +264,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -300,7 +281,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -318,7 +298,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -336,7 +315,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -354,7 +332,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -372,7 +349,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -390,7 +366,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -407,7 +382,6 @@ Array [
"headers": Object {
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -424,7 +398,6 @@ Array [
"headers": Object {
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -441,7 +414,6 @@ Array [
"headers": Object {
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -457,7 +429,6 @@ Array [
"headers": Object {
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -473,7 +444,6 @@ Array [
"headers": Object {
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -490,7 +460,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic dGVzdDp0ZXN0",
"cache-control": "no-cache",
"host": "test.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -507,7 +476,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Basic XXX",
"cache-control": "no-cache",
"host": "registry.npmjs.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand All @@ -524,7 +492,6 @@ Array [
"accept": "application/json",
"accept-encoding": "gzip, deflate",
"authorization": "Bearer XXX",
"cache-control": "no-cache",
"host": "registry.npmjs.org",
"user-agent": "https://github.com/renovatebot/renovate",
},
Expand Down

0 comments on commit bca8931

Please sign in to comment.