Skip to content

Conversation

@rubionic
Copy link

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:

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

…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
@rubionic rubionic requested review from a team and nikola-jokic as code owners December 29, 2025 17:34
Copy link
Collaborator

@nikola-jokic nikola-jokic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Collaborator

@nikola-jokic nikola-jokic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to conditionali mkdir in prepareJobgScript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

no-volume initialize containers fails

2 participants