From 580756b1ad15bb020ddcf8652f9e03935e83efbc Mon Sep 17 00:00:00 2001 From: Serge Logvinov Date: Sun, 28 Apr 2024 12:00:57 +0300 Subject: [PATCH] Customize work directory It allows us to customize the working directory during worker registration. --- .../actions.github.com/ephemeralrunner_controller.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/controllers/actions.github.com/ephemeralrunner_controller.go b/controllers/actions.github.com/ephemeralrunner_controller.go index 053e88ffd7..f11635f254 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{}