diff --git a/controllers/actions.github.com/ephemeralrunner_controller.go b/controllers/actions.github.com/ephemeralrunner_controller.go index 053e88ff..f11635f2 100644 --- a/controllers/actions.github.com/ephemeralrunner_controller.go +++ b/controllers/actions.github.com/ephemeralrunner_controller.go @@ -522,6 +522,14 @@ func (r *EphemeralRunnerReconciler) updateStatusWithRunnerConfig(ctx context.Con jitSettings := &actions.RunnerScaleSetJitRunnerSetting{ Name: ephemeralRunner.Name, } + + for i := range ephemeralRunner.Spec.Spec.Containers { + if ephemeralRunner.Spec.Spec.Containers[i].Name == EphemeralRunnerContainerName && + ephemeralRunner.Spec.Spec.Containers[i].WorkingDir != "" { + jitSettings.WorkFolder = ephemeralRunner.Spec.Spec.Containers[i].WorkingDir + } + } + jitConfig, err := actionsClient.GenerateJitRunnerConfig(ctx, jitSettings, ephemeralRunner.Spec.RunnerScaleSetId) if err != nil { actionsError := &actions.ActionsError{}