Add support for cleaning up SDK files #485
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #398
In another MR, @dscho's suggestion was as follows:
I totally agree with this and have looked into several options to implement this.
Options
Roughly speaking, I think we have the following options:
cleanup
input parameter that folks can use on self-hosted runners (implemented in this PR)RUNNER_TEMP
variable foroutputDirectory
to write temporary files. From the docs:self-hosted
, execute the cleanup logic. Looks like we'd need to do an API call tohttps://api.github.com/repos/OWNER/REPO/actions/jobs/JOB_ID
to get those labels, which is a bit involved because it needs aGITHUB_TOKEN
as well. https://github.com/octokit/action.js should make things a bit easier, but the requirement for theGITHUB_TOKEN
remains.RUNNER_TYPE
(self-hosted or github-hosted) to the runner's environment variablesFeasibility check of options
RUNNER_TEMP
but instead destroy the entire VM right away. Self-hosted runners will clean up this folder, so that's exactly the behavior we're looking for, right? What about thepath
input parameter in your Action? Should that also useRUNNER_TEMP
as a base folder in this case, or is that parameter expected to have exact paths (e.g.C:\my-dir
)?GITHUB_TOKEN
.Curious to hear your thoughts on this!