Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit ffcaab8

Browse files
committed
Allow proper overwrites and fail if undef
1 parent 6adc6db commit ffcaab8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

manifests/instance.pp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,20 @@
6767
$assured_labels = ''
6868
}
6969

70-
if $enterprise_name {
71-
$token_url = "${github_api}/enterprises/${enterprise_name}/actions/runners/registration-token"
72-
$url = "${github_domain}/enterprises/${enterprise_name}"
73-
} elsif $repo_name {
70+
if $repo_name {
7471
$token_url = "${github_api}/repos/${org_name}/${repo_name}/actions/runners/registration-token"
7572
$url = "${github_domain}/${org_name}/${repo_name}"
76-
} else {
73+
} elsif $org_name {
7774
$token_url = $github_api ? {
7875
'https://api.github.com' => "${github_api}/repos/${org_name}/actions/runners/registration-token",
7976
default => "${github_api}/orgs/${org_name}/actions/runners/registration-token",
8077
}
8178
$url = "${github_domain}/${org_name}"
79+
} elsif $enterprise_name {
80+
$token_url = "${github_api}/enterprises/${enterprise_name}/actions/runners/registration-token"
81+
$url = "${github_domain}/enterprises/${enterprise_name}"
82+
} else {
83+
fail("At least one of 'repo_name', 'org_name', 'enterprise_name' is required to create runner instances.")
8284
}
8385

8486
$archive_name = "${github_actions_runner::package_name}-${github_actions_runner::package_ensure}.tar.gz"

0 commit comments

Comments
 (0)