GitHubWebhook
GitHubWebhook defines a webhook which can be triggered by GitHub webhook events. This is useful for integrating Pullup into your GitHub repositories.
Model#
spec.triggers#
Required
See HTTPWebhook for more details.
spec.action#
See HTTPWebhook for more details.
spec.repositories#
Required
The repositories to handle. This value is an array of objects which contains the following fields.
nameRequired - Full name of a repository. (e.g.tommy351/pullup)pushpullRequest
You have to specify one of push or pullRequest field to activate the webhook.
Event Filter#
Event filter is an object containing the following fields.
include- List of conditions to include.exclude- List of conditions to exclude.
You can use a string or a regular expression in these fields.
push#
Handle push events.
| Key | Type | Description |
|---|---|---|
branches | EventFilter | Filter events by branches. |
tags | EventFilter | Filter events by tags. |
pullRequest#
Handle pull_request events.
| Key | Type | Description |
|---|---|---|
branches | EventFilter | Filter events by pull request base branches. |
tags | EventFilter | Filter events by pull request labels. |
types | []string | Pull request events to handle. Available values are assigned, unassigned, labeled, unlabeled, opened, edited, closed, reopened, synchronize, ready_for_review, locked, unlocked, review_requested, review_request_removed. Default to ["opened", "synchronize", "reopened", "closed"]. |
Setup#
Creating Webhooks on GitHub#
See GitHub docs for more details.
- Payload URL:
http://your-site.com/webhooks/github - Content Type: Choose
application/json - Secret: See Securing Webhooks below.
Securing Webhooks#
It is recommended to set a secret on your webhook in order to make sure the payload is sent from GitHub. Set GITHUB_SECRET environment variable on the pullup-webhook deployment to enable this feature.
Examples#
Only GitHubWebhook specific examples are provided below. See HTTPWebhook for more examples.
Basic#
The following webhook only handles push events. Change push to pullRequest to handle pull request events instead. Noted that you can use both of them at the same time.