Skip to content
Snippets Groups Projects
Commit e2d1eeb3 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(npm): cache known publicly-scoped packages

parent e7164136
No related branches found
No related tags found
No related merge requests found
...@@ -207,7 +207,17 @@ export async function getDependency( ...@@ -207,7 +207,17 @@ export async function getDependency(
const cacheMinutes = process.env.RENOVATE_CACHE_NPM_MINUTES const cacheMinutes = process.env.RENOVATE_CACHE_NPM_MINUTES
? parseInt(process.env.RENOVATE_CACHE_NPM_MINUTES, 10) ? parseInt(process.env.RENOVATE_CACHE_NPM_MINUTES, 10)
: 5; : 5;
if (!packageName.startsWith('@')) { // TODO: use dynamic detection of public repos instead of a static list
const whitelistedPublicScopes = [
'@graphql-codegen',
'@storybook',
'@types',
'@typescript-eslint',
];
if (
whitelistedPublicScopes.includes(scope) ||
!packageName.startsWith('@')
) {
await renovateCache.set(cacheNamespace, pkgUrl, dep, cacheMinutes); await renovateCache.set(cacheNamespace, pkgUrl, dep, cacheMinutes);
} }
return dep; return dep;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment