From the course: Building GitHub Bots
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Solution: Comment when a pull request is merged
From the course: Building GitHub Bots
Solution: Comment when a pull request is merged
(upbeat music) - [Instructor] Very able to do it, very able to configure your bot to say, "Thanks," when a pull request is merged rather than closed. I know differentiating between a closed pull request and a merged pull request can be a bit tricky, but if you pay close attention to the event payload of the pull request event on the action closed, you will be able to differentiate between a closed pull request and a merged pull request. Let's check the code for this. You can see, I have written another similar router.register chunk for pull_request. It's going to be pretty similar to what we did with issues, but make sure that you are also listening to the pull request event on the webhook that you created on GitHub. Before we dive deeper into the code, let me briefly cover what router.register does. If we trace where this is coming from, then it's coming from routing.Router. And routing is coming from gigethub. So gigethub.routing is just a router for webhook events. When a single…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Development environment setup1m 33s
-
(Locked)
Get started2m 48s
-
(Locked)
Using gidgethub on the command line20m 1s
-
(Locked)
Write and deploy a "Hello World" web service14m 15s
-
(Locked)
Using gidgethub to respond to webhooks16m 54s
-
(Locked)
Do more with your GitHub bot5m 50s
-
(Locked)
Challenge: Comment when a pull request is merged29s
-
(Locked)
Solution: Comment when a pull request is merged5m 37s
-
(Locked)
-
-
-