Skip init-post cleanup on GitHub-hosted runners
This commit is contained in:
parent
d8d73c0e76
commit
ed34eb9af4
3 changed files with 35 additions and 20 deletions
24
lib/init-action-post-helper.js
generated
24
lib/init-action-post-helper.js
generated
|
|
@ -135,16 +135,22 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p
|
|||
await uploadLogsDebugArtifact(config);
|
||||
await printDebugLogs(config);
|
||||
}
|
||||
try {
|
||||
fs.rmSync(config.dbLocation, {
|
||||
recursive: true,
|
||||
force: true,
|
||||
maxRetries: 3,
|
||||
});
|
||||
logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`);
|
||||
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}`);
|
||||
}
|
||||
}
|
||||
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.");
|
||||
}
|
||||
return uploadFailedSarifResult;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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.",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue