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

Commit 6506850

Browse files
author
shimon
committed
improve documentation, use selector.
1 parent 04feb32 commit 6506850

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# GitHub Actions Runner
22

3-
This module is designed to automatically configure all requirements to have the GitHub Actions runner ready to run on Debian hosts as a service.
3+
Automatic configuration for running GitHub Actions on Debian hosts as a service
44

55
#### Table of Contents
66

@@ -42,3 +42,4 @@ If you don't specify repository name , make sure you `Personal Access Token` is
4242
### Development
4343

4444
This module development should be just like any other puppet modules.
45+
Use PDK to run unit tests: `pdk test unit`

manifests/init.pp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
# * group
4444
# String, Group to be used in Service and directories.
4545
#
46-
46+
# * assured_labels
47+
# String, comma separated labels list to be use in the configuration script.
48+
#
4749

4850
class github_actions_runner (
4951
Enum['present', 'absent'] $ensure,
@@ -55,6 +57,7 @@
5557
String $repository_url,
5658
String $user,
5759
String $group,
60+
String $assured_labels = undef,
5861
String $hostname = $::facts['hostname'],
5962
Optional[Array[String]] $labels = undef,
6063
Optional[String] $repo_name = undef,
@@ -68,13 +71,14 @@
6871
$assured_labels="--labels ${flattend_labels_list}"
6972
}
7073

71-
if $github_actions_runner::repo_name {
72-
$url="https://github.com/${github_actions_runner::org_name}/${github_actions_runner::repo_name}"
73-
$token_url="https://api.github.com/repos/${github_actions_runner::org_name}/${github_actions_runner::repo_name}/actions/runners/registration-token"
74+
$url = $github_actions_runner::repo_name ? {
75+
undef => "https://github.com/${github_actions_runner::org_name}",
76+
default => "https://github.com/${github_actions_runner::org_name}/${github_actions_runner::repo_name}",
7477
}
75-
else {
76-
$url="https://github.com/${github_actions_runner::org_name}"
77-
$token_url="https://api.github.com/repos/${github_actions_runner::org_name}/actions/runners/registration-token"
78+
79+
$token_url = $github_actions_runner::repo_name ? {
80+
undef => "https://api.github.com/repos/${github_actions_runner::org_name}/actions/runners/registration-token",
81+
default => "https://api.github.com/repos/${github_actions_runner::org_name}/${github_actions_runner::repo_name}/actions/runners/registration-token",
7882
}
7983

8084
class { '::github_actions_runner::config': }

0 commit comments

Comments
 (0)