Invoke cleanup in analyze Action

This commit is contained in:
Henry Mercer 2024-05-21 21:12:45 +01:00
parent 4fd6c0d4f1
commit 0b4214972e
6 changed files with 32 additions and 11 deletions

14
lib/trap-caching.js generated
View file

@ -132,11 +132,17 @@ async function uploadTrapCaches(codeql, config, logger) {
return true;
}
exports.uploadTrapCaches = uploadTrapCaches;
async function cleanupTrapCaches(language, logger) {
async function cleanupTrapCaches(config, logger) {
if (!(await actionsUtil.isAnalyzingDefaultBranch()))
return;
try {
const matchingCaches = await getTrapCachesForLanguage(language);
for (const cache of matchingCaches) {
logger.info(`Matched Actions cache ${JSON.stringify(cache)}`);
for (const language of config.languages) {
if (config.trapCaches[language]) {
const matchingCaches = await getTrapCachesForLanguage(language);
for (const cache of matchingCaches) {
logger.info(`Matched Actions cache ${JSON.stringify(cache)}`);
}
}
}
}
catch (e) {