The field that you're interested in is context.payload
inside the callback:
export = (app: Application) => {
app.on('pull_request', async (context) => {
const payload = context.payload
// ...
})
}
This matches the payloads listed in the GitHub Webhook Events page: https://developer.github.com/webhooks/#events
You're interested in the pull_request
payload which can be found here: https://developer.github.com/v3/activity/events/types/#pullrequestevent
And pull_request.number
is your relevant piece of information you need:
export = (app: Application) => {
app.on('pull_request', async (context) => {
const payload = context.payload
const number = payload.pull_request.number
})
}