Skip to content

Commit 58952c9

Browse files
Add option for latest version
Former-commit-id: 7daec8f
1 parent 058c915 commit 58952c9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

molecule/default/converge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
hosts: all
55
become: yes
66
vars:
7+
- runner_version: "2.168.0"
78
- runner_user: ansible
89
- github_repo: ansible-github_actions_runner-testrepo
910
- github_account: monolithprojects

tasks/install_runner.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,24 @@
1010
tags:
1111
- install
1212

13-
- name: Find the lates runner version
13+
- name: Find the latest runner version
1414
uri:
1515
url: "https://api.github.com/repos/actions/runner/releases/latest"
16+
url_username: "{{ github_account }}"
17+
url_password: "{{ access_token }}"
1618
method: GET
1719
force_basic_auth: yes
1820
return_content: yes
1921
status_code: 200
2022
body_format: json
2123
register: api_response
22-
# run_once: yes
23-
# delegate_to: localhost
24+
run_once: yes
25+
delegate_to: localhost
2426
when: runner_version == "latest"
2527
tags:
2628
- install
2729

28-
- name: Set runner_version variable ("{{ api_response.json.tag_name | regex_replace('^v', '') }}")
30+
- name: Set runner_version variable (if it is latest)
2931
set_fact:
3032
runner_version: "{{ api_response.json.tag_name | regex_replace('^v', '') }}"
3133
when: runner_version == "latest"

0 commit comments

Comments
 (0)