feat(annotations): when no problem found, remove comment and set to approve PR

ref: #6 #5
This commit is contained in:
2025-07-12 19:12:57 +09:30
parent 6d501e25d9
commit 9727594d89
2 changed files with 12 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import json
# import requests
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:
@ -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 = {
"pull_request": pull_request,
"api_body": api_body

View File

@ -18,14 +18,14 @@
ansible.builtin.set_fact:
git_api_url: "{{ payload.repository.url }}"
when: >
git_api_url == ""
git_api_url == ""
- name: Set var gitea_replace_url if empty
ansible.builtin.set_fact:
gitea_replace_url: "{{ payload.repository.url }}"
when: >
gitea_replace_url == ""
gitea_replace_url == ""
- name: Set required Facts