Skip to content

Commit

Permalink
✨ dont forget to label it 'approve'
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Görn <goern@redhat.com>
  • Loading branch information
goern committed Jun 29, 2020
1 parent 0496085 commit 928c9cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aicoe/sesheta/review_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 928c9cb

Please sign in to comment.