@@ -111,16 +111,6 @@ function downloadAndExtractRunner() {
111
111
# chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R /home/{{ .RunnerUsername }}/actions-runner/ || fail "failed to change owner"
112
112
}
113
113
114
- {{- if not .UseJITConfig }}
115
- GH_RUNNER_GROUP="{{.GitHubRunnerGroup}}"
116
- # $RUNNER_GROUP_OPT will be added to the config.sh line. If it's empty, nothing happens
117
- # if it holds a value, it will be part of the command.
118
- RUNNER_GROUP_OPT=""
119
- if [ ! -z $GH_RUNNER_GROUP ];then
120
- RUNNER_GROUP_OPT="--runnergroup=$GH_RUNNER_GROUP"
121
- fi
122
- {{- end }}
123
-
124
114
CACHED_RUNNER=$(getCachedToolsPath)
125
115
if [ -z "$CACHED_RUNNER" ];then
126
116
downloadAndExtractRunner
@@ -171,7 +161,11 @@ set +e
171
161
attempt=1
172
162
while true; do
173
163
ERROUT=$(mktemp)
174
- ./config.sh --unattended --url "{{ .RepoURL }}" --token "$GITHUB_TOKEN" $RUNNER_GROUP_OPT --name "{{ .RunnerName }}" --labels "{{ .RunnerLabels }}" --ephemeral 2>$ERROUT
164
+ {{- if .GitHubRunnerGroup }}
165
+ ./config.sh --unattended --url "{{ .RepoURL }}" --token "$GITHUB_TOKEN" --runnergroup {{.GitHubRunnerGroup}} --name "{{ .RunnerName }}" --labels "{{ .RunnerLabels }}" --ephemeral 2>$ERROUT
166
+ {{- else}}
167
+ ./config.sh --unattended --url "{{ .RepoURL }}" --token "$GITHUB_TOKEN" --name "{{ .RunnerName }}" --labels "{{ .RunnerLabels }}" --ephemeral 2>$ERROUT
168
+ {{- end}}
175
169
if [ $? -eq 0 ]; then
176
170
rm $ERROUT || true
177
171
sendStatus "runner successfully configured after $attempt attempt(s)"
@@ -431,10 +425,7 @@ function Install-Runner() {
431
425
Update-GarmStatus -CallbackURL $CallbackURL -Message "extracting runner"
432
426
Add-Type -AssemblyName System.IO.Compression.FileSystem
433
427
[System.IO.Compression.ZipFile]::ExtractToDirectory($downloadPath, "$runnerDir")
434
- $runnerGroupOpt = ""
435
- if ($GHRunnerGroup.Length -gt 0){
436
- $runnerGroupOpt = "--runnergroup $GHRunnerGroup"
437
- }
428
+
438
429
Update-GarmStatus -CallbackURL $CallbackURL -Message "configuring and starting runner"
439
430
cd $runnerDir
440
431
@@ -460,7 +451,11 @@ function Install-Runner() {
460
451
461
452
{{- else }}
462
453
$GithubRegistrationToken = Invoke-WebRequest -UseBasicParsing -Headers @{"Accept"="application/json"; "Authorization"="Bearer $Token"} -Uri $MetadataURL/runner-registration-token/
463
- ./config.cmd --unattended --url "{{ .RepoURL }}" --token $GithubRegistrationToken $runnerGroupOpt --name "{{ .RunnerName }}" --labels "{{ .RunnerLabels }}" --ephemeral --runasservice
454
+ {{- if .GitHubRunnerGroup }}
455
+ ./config.cmd --unattended --url "{{ .RepoURL }}" --token $GithubRegistrationToken --runnergroup {{.GitHubRunnerGroup}} --name "{{ .RunnerName }}" --labels "{{ .RunnerLabels }}" --ephemeral --runasservice
456
+ {{- else}}
457
+ ./config.cmd --unattended --url "{{ .RepoURL }}" --token $GithubRegistrationToken --name "{{ .RunnerName }}" --labels "{{ .RunnerLabels }}" --ephemeral --runasservice
458
+ {{- end}}
464
459
465
460
$agentInfoFile = Join-Path $runnerDir ".runner"
466
461
$agentInfo = ConvertFrom-Json (gc -raw $agentInfoFile)
0 commit comments