Configure webhooks
You can set up webhooks for your Harness Code repositories. Webhooks can serve a variety of purposes, such as sending notifications or triggering builds.
Harness triggers and webhooks
In Harness, you can create triggers to automatically run your CI/CD pipelines in response to push events in your Harness Code repos. You don't need to create a webhook to do this.
Create a webhook
You can create ad hoc webhooks to integrate your repository with other services, such as notification services or third party CI/CD providers.
-
When viewing a repository in Harness Code, go to Webhooks, and select New Webhook.
-
Enter a webhook Name and optional Description.
-
Enter your endpoint URL in the Payload URL.
-
You can provide a Secret to sign the payload so the server can verify authenticity. If you provide a secret, the webhook call contains an
X-Harness-Signature
header. -
Specify the events that you want to trigger this webhook.
- Send me everything: All applicable events trigger the webhook. Payloads are sent to your endpoint for all events in this repo.
- Let me select individual events: Select specific events that you want to trigger this webhook. Payloads are sent to your endpoint only when the specified events occur in this repo.
Webhook triggering events include:
- Branch created, updated, or deleted
- Tag created, updated, or deleted
- PR created, closed, or reopened
- PR branch updated
- PR comment created
-
Select Enable SSL verification, if your endpoint supports it.
-
Webhooks are Enabled by default. If you don't want this webhook to be enabled yet, deselect Enabled.
-
Select Create Webhook.
Toggle webhooks
You can toggle webhooks on and off.
- Go to your repository and select Webhooks.
- Use the switch next to each webhook to enable or disable webhooks.
You can also edit the webhook and use the Enabled setting to enable or disable the webhook.
Edit or delete a webhook
- Go to your repository and select Webhooks.
- Locate the webhook that you want to edit or delete, select More options (⋮), and then select Edit or Delete.
You can also edit webhooks by selecting them directly on the webhooks list.