{{ define "title" }}{{ .Tab | capitalize }} settings · {{ .RepoInfo.FullName }} · Tangled{{ 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
Repository renamed
Pull request opened
Pull request resubmitted
Pull request merged
Pull request closed
Pull request reopened

Additional event types (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 }} {{ $hasRepoRenamed := false }} {{ $hasPullCreated := false }} {{ $hasPullResubmitted := false }} {{ $hasPullMerged := false }} {{ $hasPullClosed := false }} {{ $hasPullReopened := false }} {{ range $webhook.Events }} {{ if eq . "push" }}{{ $hasPush = true }}{{ end }} {{ if eq . "repository:renamed" }}{{ $hasRepoRenamed = true }}{{ end }} {{ if eq . "pull_request:created" }}{{ $hasPullCreated = true }}{{ end }} {{ if eq . "pull_request:resubmitted" }}{{ $hasPullResubmitted = true }}{{ end }} {{ if eq . "pull_request:merged" }}{{ $hasPullMerged = true }}{{ end }} {{ if eq . "pull_request:closed" }}{{ $hasPullClosed = true }}{{ end }} {{ if eq . "pull_request:reopened" }}{{ $hasPullReopened = true }}{{ end }} {{ end }}
Push events
Repository renamed
Pull request opened
Pull request resubmitted
Pull request merged
Pull request closed
Pull request reopened

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

Enable
{{ end }}