mirror of
https://github.com/github/codeql-action.git
synced 2026-05-02 11:50:08 +00:00
Skip init-post cleanup on GitHub-hosted runners
This commit is contained in:
Generated
+15
-9
@@ -135,16 +135,22 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p
|
|||||||
await uploadLogsDebugArtifact(config);
|
await uploadLogsDebugArtifact(config);
|
||||||
await printDebugLogs(config);
|
await printDebugLogs(config);
|
||||||
}
|
}
|
||||||
try {
|
if (actionsUtil.isSelfHostedRunner()) {
|
||||||
fs.rmSync(config.dbLocation, {
|
try {
|
||||||
recursive: true,
|
fs.rmSync(config.dbLocation, {
|
||||||
force: true,
|
recursive: true,
|
||||||
maxRetries: 3,
|
force: true,
|
||||||
});
|
maxRetries: 3,
|
||||||
logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`);
|
});
|
||||||
|
logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
logger.warning(`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
else {
|
||||||
logger.warning(`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`);
|
logger.debug("Skipping cleanup of database cluster directory since we are running on a GitHub-hosted " +
|
||||||
|
"runner which will be automatically cleaned up.");
|
||||||
}
|
}
|
||||||
return uploadFailedSarifResult;
|
return uploadFailedSarifResult;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -219,16 +219,25 @@ export async function run(
|
|||||||
await printDebugLogs(config);
|
await printDebugLogs(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (actionsUtil.isSelfHostedRunner()) {
|
||||||
fs.rmSync(config.dbLocation, {
|
try {
|
||||||
recursive: true,
|
fs.rmSync(config.dbLocation, {
|
||||||
force: true,
|
recursive: true,
|
||||||
maxRetries: 3,
|
force: true,
|
||||||
});
|
maxRetries: 3,
|
||||||
logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`);
|
});
|
||||||
} catch (e) {
|
logger.info(
|
||||||
logger.warning(
|
`Cleaned up database cluster directory ${config.dbLocation}.`,
|
||||||
`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`,
|
);
|
||||||
|
} catch (e) {
|
||||||
|
logger.warning(
|
||||||
|
`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.debug(
|
||||||
|
"Skipping cleanup of database cluster directory since we are running on a GitHub-hosted " +
|
||||||
|
"runner which will be automatically cleaned up.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user