{{ define "title" }}{{ .Tab }} settings · {{ .RepoInfo.FullName }}{{ end }} {{ define "repoContent" }}
{{ template "repo/settings/fragments/sidebar" . }}
{{ template "webhooksSettings" . }}
{{ end }} {{ define "webhooksSettings" }}

Webhooks

Webhooks allow external services to be notified when certain events happen. When the specified events happen, we'll send a POST request to each of the URLs you provide.

{{ template "addWebhookModal" . }}
{{ range .Webhooks }}
{{ .Url }} {{ if .Active }} {{ i "circle-check" "size-4" }} active {{ else }} {{ i "circle" "size-4" }} inactive {{ end }}
Events: {{ range $i, $e := .Events }}{{ if $i }}, {{ end }}{{ $e }}{{ end }}
{{ if $.RepoInfo.Roles.IsOwner }}
{{ end }}
{{ if $.RepoInfo.Roles.IsOwner }}
{{ end }} {{ $deliveries := index $.WebhookDeliveries .Id }} {{ if $deliveries }}

Recent Deliveries

{{ range $deliveries }}
{{ if .Success }} {{ i "circle-check" "size-3" }} {{ .ResponseCode }} {{ else }} {{ i "circle-x" "size-3" }} {{ if .ResponseCode }}{{ .ResponseCode }}{{ else }}failed{{ end }} {{ end }} {{ .DeliveryId }} {{ .Event }} {{ .CreatedAt.Format "Jan 02, 15:04" }}
{{ end }}
{{ else }}
No deliveries yet
{{ end }}
{{ i "loader-circle" "size-6 animate-spin" }}
{{ if $.RepoInfo.Roles.IsOwner }}
{{ template "editWebhookModal" (list $ .) }}
{{ end }}
{{ else }}
no webhooks configured yet
{{ end }}
{{ end }} {{ define "addWebhookModal" }}

New Webhook

The URL that will receive the webhook POST requests.

If provided, webhook payloads will be signed with HMAC-SHA256. Leave blank to send unsigned webhooks.

Push events

Additional event types (pull requests, issues) will be available in future updates.

{{ end }} {{ define "editWebhookModal" }} {{ $ctx := index . 0 }} {{ $webhook := index . 1 }}

Edit Webhook

Leave blank to keep the existing secret. Remove value to disable signing.

{{ $hasPush := false }} {{ range $webhook.Events }} {{ if eq . "push" }}{{ $hasPush = true }}{{ end }} {{ end }}
Push events

Additional event types (pull requests, issues) will be available in future updates.

Enable
{{ end }}