Ensure uniqueness of overlay-base database cache keys

This commit is contained in:
Kasper Svendsen
2025-10-24 10:48:01 +02:00
parent c4b73722ba
commit b4ce335286
3 changed files with 15 additions and 4 deletions
+3 -1
View File
@@ -91075,12 +91075,14 @@ async function uploadOverlayBaseDatabaseToCache(codeql, config, logger) {
return true;
}
async function getCacheSaveKey(config, codeQlVersion, checkoutPath) {
const runId = getWorkflowRunID();
const attemptId = getWorkflowRunAttempt();
const sha = await getCommitOid(checkoutPath);
const restoreKeyPrefix = await getCacheRestoreKeyPrefix(
config,
codeQlVersion
);
return `${restoreKeyPrefix}${sha}`;
return `${restoreKeyPrefix}${runId}-${attemptId}-${sha}`;
}
async function getCacheRestoreKeyPrefix(config, codeQlVersion) {
const languages = [...config.languages].sort().join("_");