feat(annotations): when no problem found, remove comment and set to approve PR
ref: #6 #5
This commit is contained in:
@ -6,7 +6,7 @@ import json
|
|||||||
# import requests
|
# import requests
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
# API Docs: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#create-a-review-for-a-pull-request
|
||||||
|
|
||||||
def default_matcher( entry, tool_name = '' ) -> dict:
|
def default_matcher( entry, tool_name = '' ) -> dict:
|
||||||
|
|
||||||
@ -277,6 +277,15 @@ for msg_type, value in review_body.items():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if len(api_body['comments']) == 0:
|
||||||
|
|
||||||
|
api_body.update({
|
||||||
|
'event': 'APPROVE'
|
||||||
|
})
|
||||||
|
del api_body['body']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"pull_request": pull_request,
|
"pull_request": pull_request,
|
||||||
"api_body": api_body
|
"api_body": api_body
|
||||||
|
@ -18,14 +18,14 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
git_api_url: "{{ payload.repository.url }}"
|
git_api_url: "{{ payload.repository.url }}"
|
||||||
when: >
|
when: >
|
||||||
git_api_url == ""
|
git_api_url == ""
|
||||||
|
|
||||||
|
|
||||||
- name: Set var gitea_replace_url if empty
|
- name: Set var gitea_replace_url if empty
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
gitea_replace_url: "{{ payload.repository.url }}"
|
gitea_replace_url: "{{ payload.repository.url }}"
|
||||||
when: >
|
when: >
|
||||||
gitea_replace_url == ""
|
gitea_replace_url == ""
|
||||||
|
|
||||||
|
|
||||||
- name: Set required Facts
|
- name: Set required Facts
|
||||||
|
Reference in New Issue
Block a user