Skip to content

Commit 3116766

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

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

includes/usr/bin/annotations.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ 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))
211+
212+
sys.exit(0)
209213

210214

211215
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)