Skip to content

Commit

Permalink
allow actions runner name to be overridden with env var
Browse files Browse the repository at this point in the history
  • Loading branch information
robwhitby committed Oct 2, 2023
1 parent 612ca85 commit 77a792b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions renderers/actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package actions
import (
"fmt"
"golang.org/x/exp/slices"
"os"
"regexp"
"strings"
"time"
Expand All @@ -13,7 +14,16 @@ import (
"github.com/springernature/halfpipe/manifest"
)

const eeRunner = "ee-runner"
var eeRunner = "ee-runner"

// allow runner name to be overridden with env var
func runnerName() string {
fromEnv := os.Getenv("HALFPIPE_ACTIONS_RUNNER")
if fromEnv != "" {
return fromEnv
}
return eeRunner
}

var globalEnv = Env{
"ARTIFACTORY_PASSWORD": githubSecrets.ArtifactoryPassword,
Expand Down Expand Up @@ -81,7 +91,7 @@ func (a *Actions) jobs(tasks manifest.TaskList, man manifest.Manifest, parent *p

job := Job{
Name: task.GetName(),
RunsOn: eeRunner,
RunsOn: runnerName(),
Steps: convertSecrets(steps, man.Team),
TimeoutMinutes: timeoutInMinutes(task.GetTimeout()),
Needs: needs,
Expand Down

0 comments on commit 77a792b

Please sign in to comment.