Skip to content

Commit 222bd87

Browse files
author
Danny Verbeek
committed
Add support for Enterprise Server
1 parent e64ed4a commit 222bd87

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

defaults/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ reinstall_runner: no
2121
hide_sensitive_logs: yes
2222

2323
# GitHub address
24-
github_server: "https://github.com"
24+
github_url: "https://github.com"
25+
26+
# GitHub API
27+
github_api_url: "https://api.github.com"
2528

2629
# Personal Access Token for your GitHub account
2730
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"

tasks/collect_info_org.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: Get registration token (RUN ONCE)
33
uri:
4-
url: "https://api.github.com/orgs/{{ github_owner | default(github_account) }}/actions/runners/registration-token"
4+
url: "{{ github_api_url }}/orgs/{{ github_owner | default(github_account) }}/actions/runners/registration-token"
55
headers:
66
Authorization: "token {{ access_token }}"
77
Accept: "application/vnd.github.v3+json"
@@ -16,7 +16,7 @@
1616

1717
- name: Check currently registered runners (RUN ONCE)
1818
uri:
19-
url: "https://api.github.com/orgs/{{ github_owner | default(github_account) }}/actions/runners"
19+
url: "{{ github_api_url }}/orgs/{{ github_owner | default(github_account) }}/actions/runners"
2020
headers:
2121
Authorization: "token {{ access_token }}"
2222
Accept: "application/vnd.github.v3+json"

tasks/collect_info_repo.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: Get registration token (RUN ONCE)
33
uri:
4-
url: "https://api.github.com/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners/registration-token"
4+
url: "{{ github_api_url }}/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners/registration-token"
55
headers:
66
Authorization: "token {{ access_token }}"
77
Accept: "application/vnd.github.v3+json"
@@ -16,7 +16,7 @@
1616

1717
- name: Check currently registered runners (RUN ONCE)
1818
uri:
19-
url: "https://api.github.com/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
19+
url: "{{ github_api_url }}/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
2020
headers:
2121
Authorization: "token {{ access_token }}"
2222
Accept: "application/vnd.github.v3+json"
@@ -47,4 +47,4 @@
4747
runner_service: "actions.runner.{{ svc_name[:45] }}.{{ runner_name }}.service"
4848
tags:
4949
- install
50-
- uninstall
50+
- uninstall

tasks/install_runner.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
uri:
1515
url: "https://api.github.com/repos/actions/runner/releases/latest"
1616
headers:
17-
Authorization: "token {{ access_token }}"
18-
Accept: "application/vnd.github.v3+json"
17+
Content-Type: "application/json"
1918
method: GET
20-
force_basic_auth: yes
2119
return_content: yes
2220
status_code: 200
2321
body_format: json

0 commit comments

Comments
 (0)