Closed JoAnnaEsq closed 6 years ago
When a user opens an empty issue or pull request, the Request Info app will do exactly that -- request some more information.
It looks like you included some text in the body of the pull request, so you didn't see a response. To see what the app would have said, pay attention to the Files changed tab in the next activity.
Per the app installation instructions, this app requires a .github/config.yml
file for it to respond with a default message. I've already included that in this pull request for you. Some apps use these, and some don't use them at all. Some apps might use a .json
file, while others might ask you to store configuration settings in a .md
file.
This allows you to take default templates and extend them to your own projects.
Let's use your default template to learn about APIs. First, make a simple change to the standard message.
config.yml
fileNice job!
In the last pull request, we learned about webhooks and how the WIP and Request Info apps only respond to specific events. Webhooks allow you to build or set up GitHub Apps which subscribe to certain events on GitHub. When one of those events is triggered, an HTTP POST payload response is sent to the webhook's configured URL. We saw this with our smee.io webhook.
But webhooks are only one side to this story. To see the other side, meet API endpoints. :wave:
API stands for Application Programming Interface. APIs are used to share data or functionality. This is done by making an HTTP request to an API using an endpoint, and then receiving a reponse back.
For example, this is the endpoint to create a new pull request; POST /repos/:owner/:repo/pulls
When an event is triggered, the vastly more detailed GitHub API gives the bot an excessive amount of information (as a payload). The bot takes this payload, alters it slightly, and hands it back to GitHub's API, which delivers the change back to your repository.
POST /repos/:owner/:repo/labels
Great work! That's the correct API endpoint.
APIs and Webhooks go hand in hand, but the distinction between them is important.
Now that you've made the change to your config.yml
file, try to trigger that event to see the changes as a user.
config.yml
took effect!
Change the config file.