mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 16:58:47 +00:00
Improve error handling for overlay-base cache key creation
This commit is contained in:
Generated
+13
-4
@@ -91049,7 +91049,8 @@ async function uploadOverlayBaseDatabaseToCache(codeql, config, logger) {
|
||||
const cacheSaveKey = await getCacheSaveKey(
|
||||
config,
|
||||
codeQlVersion,
|
||||
checkoutPath
|
||||
checkoutPath,
|
||||
logger
|
||||
);
|
||||
logger.info(
|
||||
`Uploading overlay-base database to Actions cache with key ${cacheSaveKey}`
|
||||
@@ -91074,9 +91075,17 @@ async function uploadOverlayBaseDatabaseToCache(codeql, config, logger) {
|
||||
logger.info(`Successfully uploaded overlay-base database from ${dbLocation}`);
|
||||
return true;
|
||||
}
|
||||
async function getCacheSaveKey(config, codeQlVersion, checkoutPath) {
|
||||
const runId = getWorkflowRunID();
|
||||
const attemptId = getWorkflowRunAttempt();
|
||||
async function getCacheSaveKey(config, codeQlVersion, checkoutPath, logger) {
|
||||
let runId = 1;
|
||||
let attemptId = 1;
|
||||
try {
|
||||
runId = getWorkflowRunID();
|
||||
attemptId = getWorkflowRunAttempt();
|
||||
} catch (e) {
|
||||
logger.warning(
|
||||
`Failed to get workflow run ID or attempt ID. Reason: ${getErrorMessage(e)}`
|
||||
);
|
||||
}
|
||||
const sha = await getCommitOid(checkoutPath);
|
||||
const restoreKeyPrefix = await getCacheRestoreKeyPrefix(
|
||||
config,
|
||||
|
||||
Reference in New Issue
Block a user