Skip to content

Ability to use custom GitHub Actions Runner forks #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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