mirror of
https://github.com/github/codeql-action.git
synced 2025-12-31 03:30:14 +08:00
Skip init-post cleanup on GitHub-hosted runners
This commit is contained in:
@@ -219,16 +219,25 @@ export async function run(
|
||||
await printDebugLogs(config);
|
||||
}
|
||||
|
||||
try {
|
||||
fs.rmSync(config.dbLocation, {
|
||||
recursive: true,
|
||||
force: true,
|
||||
maxRetries: 3,
|
||||
});
|
||||
logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`);
|
||||
} catch (e) {
|
||||
logger.warning(
|
||||
`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`,
|
||||
if (actionsUtil.isSelfHostedRunner()) {
|
||||
try {
|
||||
fs.rmSync(config.dbLocation, {
|
||||
recursive: true,
|
||||
force: true,
|
||||
maxRetries: 3,
|
||||
});
|
||||
logger.info(
|
||||
`Cleaned up database cluster directory ${config.dbLocation}.`,
|
||||
);
|
||||
} 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