fix: clean gradle caches under $HOME, not hardcoded /root - #79
Merged
Conversation
With RUN_AS_ROOT=false the runner (and this job-completed hook) runs as the runner user, whose gradle home is /home/runner/.gradle — the /root paths silently stopped matching and caches grew unbounded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the post-job cleanup hook to correctly remove Gradle caches regardless of whether the runner is executed as root or as the non-root runner user, preventing cache growth when RUN_AS_ROOT=false.
Changes:
- Replace hardcoded
/root/.gradle/...cache cleanup paths with$HOME/.gradle/...so cleanup works for both execution modes. - Apply the same
$HOME-based path update to Gradle daemon state/log cleanup.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The rustd.xyz runners are switching to
RUN_AS_ROOT=false(compscidr/iac#529): 12 of its tests assert permission-denied behavior that root bypasses. In non-root mode the job-completed cleanup hook runs as therunneruser, whose gradle home is/home/runner/.gradle, so the hardcoded/root/.gradlecleanups silently no-op and caches grow unbounded.$HOMEcovers both modes.🤖 Generated with Claude Code