-
Notifications
You must be signed in to change notification settings - Fork 367
feat: add post cleanup script to actions/setup to erase /tmp/gh-aw/ #22938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
7f829cc
a85fa22
6af1d19
bb4c922
09bfa8c
a75f283
7981cbd
1eff4a2
7e43397
6a4781d
d92b019
d4059f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // Setup Activation Action - Post Cleanup | ||
| // Removes the /tmp/gh-aw/ directory created during the main action step. | ||
| // Runs in the post-job phase so that temporary files are erased after the | ||
| // workflow job completes, regardless of success or failure. | ||
|
|
||
| const fs = require("fs"); | ||
|
|
||
| const tmpDir = "/tmp/gh-aw"; | ||
|
|
||
| try { | ||
| fs.rmSync(tmpDir, { recursive: true, force: true }); | ||
|
pelikhan marked this conversation as resolved.
Outdated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good use of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed β the best-effort cleanup approach is the right call here. No need to fail the job over a temp dir cleanup. π€
|
||
| console.log(`Cleaned up ${tmpDir}`); | ||
| } catch (err) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| // Log but do not fail β cleanup is best-effort | ||
| console.error(`Warning: failed to clean up ${tmpDir}: ${err.message}`); | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.