Skip to content

Commit d8d73c0

Browse files
committed
Clean up DB cluster directory at the end of each job
1 parent 3d849e9 commit d8d73c0

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

Diff for: lib/init-action-post-helper.js

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: lib/init-action-post-helper.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/init-action-post-helper.ts

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as fs from "fs";
2+
13
import * as core from "@actions/core";
24
import * as github from "@actions/github";
35

@@ -217,6 +219,19 @@ export async function run(
217219
await printDebugLogs(config);
218220
}
219221

222+
try {
223+
fs.rmSync(config.dbLocation, {
224+
recursive: true,
225+
force: true,
226+
maxRetries: 3,
227+
});
228+
logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`);
229+
} catch (e) {
230+
logger.warning(
231+
`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`,
232+
);
233+
}
234+
220235
return uploadFailedSarifResult;
221236
}
222237

0 commit comments

Comments
 (0)