Skip to content

Commit c9d74d5

Browse files
committed
feat(problem_matcher): when not enabled, dont process further
ref: #6
1 parent d60383e commit c9d74d5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

includes/usr/bin/annotations.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ def pylint_matcher( entry ) -> dict:
205205

206206
if not NFC_PROBLEM_MATCHER:
207207

208-
sys.exit(2)
208+
print(json.dumps({
209+
'pull_request': ''
210+
}, indent=4))
209211

210212

211213
if not results:

playbooks/problem_matcher.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,15 @@
9494
validate_certs: false
9595
no_log: "{{ disable_logging }}"
9696
register: http_get_pull_request
97+
when: >
98+
annotations.pull_request | string
9799
98100
99101
- name: Trace - Display Pull Request State
100102
ansible.builtin.debug:
101103
msg: "{{ http_get_pull_request.json.state | default('No PR found') }}"
104+
when: >
105+
not http_get_pull_request.skipped | bool | default(false)
102106
103107
104108
- name: Post review
@@ -117,3 +121,5 @@
117121
http_get_pull_request.json.state | default('-') != 'closed'
118122
and
119123
http_get_pull_request.status == 200
124+
and
125+
not http_get_pull_request.skipped | bool | default(false)

0 commit comments

Comments
 (0)