Commit 1911557
committed
fix(k8s): always copy GitHub workspace directories regardless of userMountVolumes
**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 #299
Related: rkoster/deskrun#28, rkoster/rubionic-workspace#2261 parent 5f5708a commit 1911557
1 file changed
+19
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
| |||
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
126 | 125 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
135 | 134 | | |
136 | | - | |
137 | | - | |
| 135 | + | |
138 | 136 | | |
| 137 | + | |
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
| |||
0 commit comments