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

Commit fb9e8f4

Browse files
author
Joel Garboden
committed
Support Github Enterprise Server self-hosted Actions
1 parent 25f5c3e commit fb9e8f4

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
String $user,
5353
String $group,
5454
Hash[String, Hash] $instances,
55+
String $github_domain,
56+
String $github_api,
5557
) {
5658

5759
$root_dir = "${github_actions_runner::base_dir_name}-${github_actions_runner::package_ensure}"

manifests/instance.pp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
String $instance_name = $title,
4141
Optional[Array[String]] $labels = undef,
4242
Optional[String] $repo_name = undef,
43-
43+
String $github_domain = $github_actions_runner::github_domain,
44+
String $github_api = $github_actions_runner::github_api,
4445
) {
4546

4647
if $labels {
@@ -51,13 +52,17 @@
5152
}
5253

5354
$url = $repo_name ? {
54-
undef => "https://github.com/${org_name}",
55-
default => "https://github.com/${org_name}/${repo_name}",
55+
undef => "${github_domain}/${org_name}",
56+
default => "${github_domain}/${org_name}/${repo_name}",
5657
}
5758

58-
$token_url = $repo_name ? {
59-
undef => "https://api.github.com/repos/${org_name}/actions/runners/registration-token",
60-
default => "https://api.github.com/repos/${org_name}/${repo_name}/actions/runners/registration-token",
59+
if $repo_name {
60+
$token_url = "${github_api}/repos/${org_name}/${repo_name}/actions/runners/registration-token"
61+
} else {
62+
$token_url = $github_api ? {
63+
'https://api.github.com' => "${github_api}/repos/${org_name}/actions/runners/registration-token",
64+
default => "${github_api}/orgs/${org_name}/actions/runners/registration-token",
65+
}
6166
}
6267

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

0 commit comments

Comments
 (0)