Skip to content

Commit

Permalink
Clean up DB cluster directory at the end of each job
Browse files Browse the repository at this point in the history
  • Loading branch information
henrymercer committed Jun 12, 2024
1 parent 3d849e9 commit d8d73c0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lib/init-action-post-helper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action-post-helper.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/init-action-post-helper.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import * as fs from "fs";

import * as core from "@actions/core";
import * as github from "@actions/github";

Expand Down Expand Up @@ -217,6 +219,19 @@ 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}`,
);
}

return uploadFailedSarifResult;
}

Expand Down

0 comments on commit d8d73c0

Please sign in to comment.