Skip to content

Commit a364a9f

Browse files
Merge pull request #79 from MonolithProjects/develop
Ability to use custom GitHub Actions Runner forks
2 parents 5d619de + 1dbff6b commit a364a9f

File tree

6 files changed

+26
-4
lines changed

6 files changed

+26
-4
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
tag: "latest"
2424
- os: "debian10"
2525
tag: "latest"
26-
- os: "fedora33"
26+
- os: "fedora34"
2727
tag: "latest"
2828
- os: "ubuntu18"
2929
tag: "latest"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
.cache
12
*.gz

.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: check-yaml
6+
args: [--allow-multiple-documents]
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ runner_name: "{{ ansible_hostname }}"
8585
# Labels to apply to the runner
8686
runner_labels: []
8787

88+
# GitHub Actions Runner repository (change it if you want to use custom Actions Runner fork)
89+
runner_download_repository: "actions/runner"
90+
91+
# Extra arguments to pass to `config.sh`
92+
runner_extra_config_args: ""
93+
8894
# Custom service name when usign Github Enterprise server
8995
# service_name: actions.runner._services.{{ runner_name }}.service
9096

defaults/main.yml

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ runner_name: "{{ ansible_hostname }}"
3838
# Labels to apply to the runner
3939
runner_labels: []
4040

41+
# GitHub Actions Runner repository (change it if you want to use custom Actions Runner fork)
42+
runner_download_repository: "actions/runner"
43+
44+
# Extra arguments to pass to `config.sh`
45+
runner_extra_config_args: ""
46+
4147
# Custom service name when usign Github Enterprise server
4248
# service_name: actions.runner._services.{{ runner_name }}.service
4349

tasks/install_runner.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
- name: Find the latest runner version (RUN ONCE)
1313
uri:
14-
url: "https://api.github.com/repos/actions/runner/releases/latest"
14+
url: "https://api.github.com/repos/{{ runner_download_repository }}/releases/latest"
1515
headers:
1616
Content-Type: "application/json"
1717
method: GET
@@ -54,7 +54,7 @@
5454

5555
- name: Download runner package version - "{{ runner_version }}" (RUN ONCE)
5656
get_url:
57-
url: "https://github.com/actions/runner/releases/download/v{{ runner_version }}/\
57+
url: "https://github.com/{{ runner_download_repository }}/releases/download/v{{ runner_version }}/\
5858
actions-runner-linux-{{ github_actions_architecture }}-{{ runner_version }}.tar.gz"
5959
dest: "{{ runner_pkg_tempdir }}/actions-runner-linux-{{ runner_version }}.tar.gz"
6060
force: no
@@ -77,7 +77,8 @@
7777

7878
- name: Register runner (if new installation) for repo
7979
command: "{{ runner_dir }}/./config.sh --url {{ github_url }}/{{ github_owner | default(github_account) }}/{{ github_repo }} \
80-
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended"
80+
--token {{ registration.json.token }} --name {{ runner_name }} --labels {{ runner_labels | join(',') }} --unattended \
81+
{{ runner_extra_config_args }}"
8182
args:
8283
chdir: "{{ runner_dir }}"
8384
become: yes

0 commit comments

Comments
 (0)