Skip to content

Repository Webhook

Definition of a Webhook on repository level, the following properties are supported:

Key Value Description Notes
url string The payload url to which a POST request will be sent when the webhook gets triggered
active boolean If the webhook is active
aliases list[string] List of webhook alias urls, can be used to change the url of a webhook without re-creating the webhook as a whole read-only property
content_type string The content type the webhook shall use json or form
events list[string] List of events that trigger the webhook supported events
insecure_ssl string If the webhook uses insecure ssl connections 0 or 1
secret SecretValue or null The secret the webhook shall use if any

The secret should reference a credential provider instead of being written in clear text, see SecretValue.

Jsonnet Function

orgs.newRepoWebhook('<url>') {
  <key>: <value>
}

Validation rules

  • redacted secrets (********) trigger a validation info and will skip the webhook during processing
  • content_type must either be json or form
  • insecure_ssl must either be 0 (disabled) or 1 (enabled)

Example usage

orgs.newOrg('adoptium') {
  ...
  _repositories+:: [
    ...
    orgs.newRepo('aqa-tests') {
      ...
      webhooks+: [
        orgs.newRepoWebhook('https://ci.adoptium.net/ghprbhook/') {
          events+: [
            "issue_comment",
            "pull_request"
          ],
          secret: "pass:path/to/webhook/secret",
        },
      ],
    }
  ]
}