From 928c9cb724019c9c972f07cf0700a449a9f4e954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20G=C3=B6rn?= Date: Mon, 29 Jun 2020 22:00:29 +0200 Subject: [PATCH] :sparkles: dont forget to label it 'approve' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christoph Görn --- aicoe/sesheta/review_manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aicoe/sesheta/review_manager.py b/aicoe/sesheta/review_manager.py index 303fb9d..65b1701 100755 --- a/aicoe/sesheta/review_manager.py +++ b/aicoe/sesheta/review_manager.py @@ -180,12 +180,18 @@ async def on_pr_open_or_edit(*, action, number, pull_request, repository, sender _LOGGER.debug(f"on_pr_open_or_edit: automatic update, will auto-approve {pull_request['html_url']}!") + # Let's approve the PR and put the approved label on it... try: await github_api.post( f"{pull_request['url']}/reviews", preview_api_version="symmetra", data={"body": "This is an auto-approve of an auto-PR.", "event": "APPROVE"}, ) + await github_api.post( + f"{pull_request['issue_url']}/labels", + preview_api_version="symmetra", + data={"labels": ["approved"]}, + ) except gidgethub.BadRequest as err: if err.status_code != 202: