Slide 25
Slide 25 text
Code & Coffee Pop-Up Richmond
Automating GitHub Workflow with Bots
@mariatta
Receive the webhook
@router.register("pull_request_review", action="submitted")
async def pr_reviewed(event, gh, *args, **kwargs):
reviewer = event.data["review"]["user"]["login"]
approved = event.data["review"]["state"] == "approved"
if approved and await util.is_core_dev(gh, reviewer):
...
# merge the PR, leave a comment to say thanks
Source: https://github.com/python/miss-islington/blob/master/miss_islington/status_change.py