fix(k8s): always copy GitHub workspace directories regardless of userMountVolumes#300
Open
rubionic wants to merge 1 commit intoactions:mainfrom
Open
Conversation
…MountVolumes
**Problem:**
The prepare script that copies GitHub workspace directories (/_github_workflow,
/_github_home) from /__w/_temp/ to /github/ was only created and executed when
userMountVolumes were defined. This caused failures when actions tried to access
$GITHUB_EVENT_PATH=/github/workflow/event.json in environments without user mounts.
**Root Cause:**
The conditional logic at line 102 tied the creation of the prepare script to the
presence of userMountVolumes:
```typescript
if (args.container?.userMountVolumes?.length) {
prepareScript = prepareJobScript(args.container.userMountVolumes || [])
}
```
However, the prepare script ALWAYS needs to run to copy GitHub directories - these
are required for GitHub Actions to function correctly. The user mounts are optional.
**Impact:**
This bug affected:
- Kubernetes mode runners without user-defined mount volumes
- Kubernetes-novolume mode in all configurations
- Actions that access workflow metadata (e.g., Docker Buildx reading event.json)
**Solution:**
- Remove the conditional logic - always create and execute the prepare script
- The prepareJobScript function already handles empty userMountVolumes gracefully
- Separate the concerns: GitHub directory copying (required) vs user mount setup (optional)
**Testing:**
This fix has been validated in production with deskrun's cached-privileged-kubernetes
runners, where actions like Docker Buildx can now successfully access event.json.
Fixes actions#299
Related: rkoster/deskrun#28, rkoster/rubionic-workspace#226
nikola-jokic
requested changes
Jan 5, 2026
Collaborator
nikola-jokic
left a comment
There was a problem hiding this comment.
We need to conditionali mkdir in prepareJobgScript
|
I tried to run this PR with conditional I suspect the script step is somehow messup with the setup but i'm not sure |
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.
Problem:
The prepare script that copies GitHub workspace directories (/_github_workflow, /_github_home) from /__w/_temp/ to /github/ was only created and executed when userMountVolumes were defined. This caused failures when actions tried to access $GITHUB_EVENT_PATH=/github/workflow/event.json in environments without user mounts.
Root Cause:
The conditional logic at line 102 tied the creation of the prepare script to the presence of userMountVolumes:
However, the prepare script ALWAYS needs to run to copy GitHub directories - these are required for GitHub Actions to function correctly. The user mounts are optional.
Impact:
This bug affected:
Solution:
Testing:
This fix has been validated in production with deskrun's cached-privileged-kubernetes runners, where actions like Docker Buildx can now successfully access event.json.
Fixes #299
Related: rkoster/deskrun#28