Merge pull request #1052 from Mic92/docs

Document github integration further.
This commit is contained in:
Eelco Dolstra 2021-11-02 15:29:07 +01:00 committed by GitHub
commit 2dc6d58845
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

View file

@ -8,6 +8,7 @@
- [Plugins](./plugins/README.md) - [Plugins](./plugins/README.md)
- [Declarative Projects](./plugins/declarative-projects.md) - [Declarative Projects](./plugins/declarative-projects.md)
- [Using the external API](api.md) - [Using the external API](api.md)
- [Webhooks](webhooks.md)
- [Monitoring Hydra](./monitoring/README.md) - [Monitoring Hydra](./monitoring/README.md)
## Developer's Guide ## Developer's Guide

View file

@ -99,7 +99,7 @@ GitHub following a certain naming scheme.
### Configuration options ### Configuration options
- `github_endpoint` - `github_endpoint` (defaults to https://api.github.com)
- `github_authorization.<repo-owner>` - `github_authorization.<repo-owner>`
## Github status ## Github status
@ -111,7 +111,7 @@ Sets GitHub CI status.
- `githubstatus.[].jobs` - `githubstatus.[].jobs`
Regular expression for jobs to match in the format `project:jobset:job`. Regular expression for jobs to match in the format `project:jobset:job`.
Defaults to `*:*:*`. This field is required and has no default value.
- `githubstatus.[].excludeBuildFromContext` - `githubstatus.[].excludeBuildFromContext`
@ -140,15 +140,18 @@ status we want to report. Can be repeated.
Verbatim contents of the Authorization header. See Verbatim contents of the Authorization header. See
[GitHub documentation](https://developer.github.com/v3/#authentication) for [GitHub documentation](https://developer.github.com/v3/#authentication) for
details. details. This field is only used if `github_authorization.<repo-owner>` is not set.
### Example ### Example
```xml ```xml
<githubstatus> <githubstatus>
jobs = test:pr:build jobs = test:pr:build
## This example will match all jobs
#jobs = .*
inputs = src inputs = src
authorization = Basic notgivingyoumypasswordosorry authorization = Bearer gha-secret😱secret😱secret😱
excludeBuildFromContext = 1 excludeBuildFromContext = 1
</githubstatus> </githubstatus>
``` ```

View file

@ -0,0 +1,13 @@
# Webhooks
Hydra can be notified by github's webhook to trigger a new evaluation when a
jobset has a github repo in its input.
To set up a github webhook go to `https://github.com/<yourhandle>/<yourrepo>/settings` and in the `Webhooks` tab
click on `Add webhook`.
- In `Payload URL` fill in `https://<your-hydra-domain>/api/push-github`.
- In `Content type` switch to `application/json`.
- The `Secret` field can stay empty.
- For `Which events would you like to trigger this webhook?` keep the default option for events on `Just the push event.`.
Then add the hook with `Add webhook`.