Skip to content

Commit de6d16f

Browse files
author
Thomas Lejeune
committed
Improve assert test and messages
1 parent 52ce09e commit de6d16f

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

tasks/assert.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
- github_account is defined
66
- access_token is defined
77
- access_token | length > 0
8-
fail_msg: "access_token was not found."
8+
- access_token | regex_search('^ghp_')
9+
fail_msg: "access_token was not found or invalid"
910
run_once: yes
1011
tags:
1112
- install

tasks/collect_info_org.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- block:
3-
- name: Get registration token (RUN ONCE)
3+
- name: Get registration token for Orgs (RUN ONCE)
44
uri:
55
url: "{{ github_api_url }}/orgs/{{ github_owner | default(github_account) }}/actions/runners/registration-token"
66
headers:
@@ -15,7 +15,7 @@
1515
- install
1616
- uninstall
1717

18-
- name: Check currently registered runners (RUN ONCE)
18+
- name: Check currently registered runners for Orgs (RUN ONCE)
1919
uri:
2020
url: "{{ github_api_url }}/orgs/{{ github_owner | default(github_account) }}/actions/runners"
2121
headers:

tasks/collect_info_repo.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- block:
3-
- name: Get registration token (RUN ONCE)
3+
- name: Get registration token for non-Orgs (RUN ONCE)
44
uri:
55
url: "{{ github_api_url }}/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners/registration-token"
66
headers:
@@ -15,7 +15,7 @@
1515
- install
1616
- uninstall
1717

18-
- name: Check currently registered runners (RUN ONCE)
18+
- name: Check currently registered runners for non-Orgs (RUN ONCE)
1919
uri:
2020
url: "{{ github_api_url }}/repos/{{ github_owner | default(github_account) }}/{{ github_repo }}/actions/runners"
2121
headers:

tasks/install_runner.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
runner_version: "{{ api_response.json.tag_name | regex_replace('^v', '') }}"
3333
when: runner_version == "latest"
3434

35+
name: Show the runner_version
36+
debug:
37+
msg: "runner_version: {{ runner_version }}"
38+
3539
- name: Check if desired version already installed
3640
command: "grep -i {{ runner_version }} {{ runner_dir }}/bin/Runner.Listener.deps.json"
3741
register: runner_installed

0 commit comments

Comments
 (0)