From 1ea1f42f2a433bd2c0ce96e86a5a37a8592e79d7 Mon Sep 17 00:00:00 2001 From: Sandro Date: Fri, 30 Aug 2024 10:52:31 +0200 Subject: [PATCH] Use for Default group for self-hosted Actions to improve compatibility --- internal/core/constants.go | 6 ++++-- internal/ghworkflow/utils.go | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/core/constants.go b/internal/core/constants.go index 967728a..7ad4a75 100644 --- a/internal/core/constants.go +++ b/internal/core/constants.go @@ -19,10 +19,12 @@ const ( DefaultGoVersion = "1.23.0" DefaultPostgresVersion = "16" DefaultLinkerdAwaitVersion = "0.2.7" - DefaultGitHubComRunnerType = "ubuntu-latest" + DefaultGitHubComRunsOn = "ubuntu-latest" ) -var DefaultGitHubEnterpriseRunnerType = [...]string{"self-hosted"} +var DefaultGitHubEnterpriseRunsOn = map[string][]string{ + "groups": {"Default"}, +} const ( CheckoutAction = "actions/checkout@v4" diff --git a/internal/ghworkflow/utils.go b/internal/ghworkflow/utils.go index 46d800f..4d8e10e 100644 --- a/internal/ghworkflow/utils.go +++ b/internal/ghworkflow/utils.go @@ -37,23 +37,23 @@ func pushAndPRTriggers(defaultBranch string, ignorePaths []string) eventTrigger func baseJob(name string, isSelfHostedRunner bool) job { var ( - runnerType any - envs map[string]string + runsOn any + envs map[string]string ) if isSelfHostedRunner { - runnerType = core.DefaultGitHubEnterpriseRunnerType + runsOn = core.DefaultGitHubEnterpriseRunsOn envs = map[string]string{ "NODE_EXTRA_CA_CERTS": "/etc/ssl/certs/ca-certificates.crt", } } else { - runnerType = core.DefaultGitHubComRunnerType + runsOn = core.DefaultGitHubComRunsOn } return job{ Name: name, Env: envs, - RunsOn: runnerType, + RunsOn: runsOn, Steps: []jobStep{{ Name: "Check out code", Uses: core.CheckoutAction,