diff --git a/includes/usr/bin/annotations.py b/includes/usr/bin/annotations.py index 4ffef7b..ce05480 100755 --- a/includes/usr/bin/annotations.py +++ b/includes/usr/bin/annotations.py @@ -205,7 +205,11 @@ for line in sys.stdin: if not NFC_PROBLEM_MATCHER: - sys.exit(2) + print(json.dumps({ + 'pull_request': '' + }, indent=4)) + + sys.exit(0) if not results: diff --git a/playbooks/problem_matcher.yaml b/playbooks/problem_matcher.yaml index 656ff71..94a3fcb 100644 --- a/playbooks/problem_matcher.yaml +++ b/playbooks/problem_matcher.yaml @@ -94,11 +94,15 @@ validate_certs: false no_log: "{{ disable_logging }}" register: http_get_pull_request + when: > + annotations.pull_request | string - name: Trace - Display Pull Request State ansible.builtin.debug: msg: "{{ http_get_pull_request.json.state | default('No PR found') }}" + when: > + not http_get_pull_request.skipped | bool | default(false) - name: Post review @@ -116,4 +120,6 @@ when: > http_get_pull_request.json.state | default('-') != 'closed' and - http_get_pull_request.status == 200 + http_get_pull_request.status | default(0) == 200 + and + not http_get_pull_request.skipped | bool | default(false)