Log key and ref for which we're retrieving caches

This commit is contained in:
Henry Mercer 2024-05-21 21:24:12 +01:00
parent 0b4214972e
commit 1bea17f717
6 changed files with 14 additions and 7 deletions

6
lib/trap-caching.js generated
View file

@ -138,7 +138,7 @@ async function cleanupTrapCaches(config, logger) {
try {
for (const language of config.languages) {
if (config.trapCaches[language]) {
const matchingCaches = await getTrapCachesForLanguage(language);
const matchingCaches = await getTrapCachesForLanguage(language, logger);
for (const cache of matchingCaches) {
logger.info(`Matched Actions cache ${JSON.stringify(cache)}`);
}
@ -150,8 +150,8 @@ async function cleanupTrapCaches(config, logger) {
}
}
exports.cleanupTrapCaches = cleanupTrapCaches;
async function getTrapCachesForLanguage(language) {
const allCaches = await apiClient.listActionsCaches(CODEQL_TRAP_CACHE_PREFIX, await actionsUtil.getRef());
async function getTrapCachesForLanguage(language, logger) {
const allCaches = await apiClient.listActionsCaches(CODEQL_TRAP_CACHE_PREFIX, await actionsUtil.getRef(), logger);
return allCaches.filter((cache) => {
return cache.key?.includes(`-${language}-`);
});