Skip to content

Commit 457f6ea

Browse files
author
Thomas Lejeune
committed
Separated checks for each variable, to have nice message
1 parent de6d16f commit 457f6ea

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

tasks/assert.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
---
2-
- name: Check variables (RUN ONCE)
2+
- name: Check github_account variable (RUN ONCE)
33
assert:
44
that:
55
- github_account is defined
6+
fail_msg: "github_account is not defined"
7+
run_once: yes
8+
tags:
9+
- install
10+
- uninstall
11+
12+
- name: Check access_token variable (RUN ONCE)
13+
assert:
14+
that:
615
- access_token is defined
716
- access_token | length > 0
817
- access_token | regex_search('^ghp_')
9-
fail_msg: "access_token was not found or invalid"
18+
fail_msg: "access_token was not found or is using an invalid format."
19+
run_once: yes
20+
tags:
21+
- install
22+
- uninstall
23+
24+
- name: Check runner_org variable (RUN ONCE)
25+
assert:
26+
that:
27+
- runner_org is bool
28+
fail_msg: "runner_org should be a boolean value"
1029
run_once: yes
1130
tags:
1231
- install

0 commit comments

Comments
 (0)