Skip to content

Commit

Permalink
Merge pull request #79 from MonolithProjects/develop
Browse files Browse the repository at this point in the history
Ability to use custom GitHub Actions Runner forks
  • Loading branch information
MonolithProjects committed May 31, 2021
2 parents 5d619de + 1dbff6b commit a364a9f
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
tag: "latest"
- os: "debian10"
tag: "latest"
- os: "fedora33"
- os: "fedora34"
tag: "latest"
- os: "ubuntu18"
tag: "latest"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.cache
*.gz
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
- id: end-of-file-fixer
- id: trailing-whitespace
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ runner_name: "{{ ansible_hostname }}"
# Labels to apply to the runner
runner_labels: []

# GitHub Actions Runner repository (change it if you want to use custom Actions Runner fork)
runner_download_repository: "actions/runner"

# Extra arguments to pass to `config.sh`
runner_extra_config_args: ""

# Custom service name when usign Github Enterprise server
# service_name: actions.runner._services.{{ runner_name }}.service

Expand Down
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ runner_name: "{{ ansible_hostname }}"
# Labels to apply to the runner
runner_labels: []

# GitHub Actions Runner repository (change it if you want to use custom Actions Runner fork)
runner_download_repository: "actions/runner"

# Extra arguments to pass to `config.sh`
runner_extra_config_args: ""

# Custom service name when usign Github Enterprise server
# service_name: actions.runner._services.{{ runner_name }}.service

Expand Down
7 changes: 4 additions & 3 deletions tasks/install_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

- name: Find the latest runner version (RUN ONCE)
uri:
url: "https://api.github.com/repos/actions/runner/releases/latest"
url: "https://api.github.com/repos/{{ runner_download_repository }}/releases/latest"
headers:
Content-Type: "application/json"
method: GET
Expand Down Expand Up @@ -54,7 +54,7 @@

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

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

0 comments on commit a364a9f

Please sign in to comment.