An Incoming Webhook Integration is used to receive a webhook from an external system (for example, GitHub) to trigger a pipeline step.
Creating an Integration
You can add this integration by following steps on the Managing Pipelines Integrations page.
Here is the information you need to create this integration:
Name -- choose a friendly name for the integration
Authorization Type -
select hmac, basic, or authorization
Secret -- secret to use with hmac authType
User Name -- username to use with basic authType to trigger the webhook
Password -- password for the user to trigger the webhook for basic authType
Authorization -- authorization to use with authorization authType to trigger the webhook
Incoming Webhook URL
When an Incoming Webhook integration is created, it generates a unique webhook URL that can be used to post information into any resource that is associated with the integration.
Usage
Incoming Webhook can be used in the Incoming Webhook resource.
The Incoming Webhook integration can also be added directly to a step in the integrations
section.
Default Environment Variables
When you create a resource with this integration, and create a step that uses it, a set of environment variables is automatically made available.
Environment variable | Description |
---|---|
| Select hmac, basic, or authorization |
| Secret to use with hmac |
| Username to use to trigger the webhook |
| Password for the user |
| Authorization to trigger the webhook |
When you add this integration directly to a step, a set of environment variables is automatically made available.
Environment variable | Description |
---|---|
| Select hmac, basic, or authorization |
| Secret to use with hmac |
| Username to use to trigger the webhook |
| Password for the user |
| Authorization to trigger the webhook |
Example
This example uses an Incoming Webhook Integration named
MyIncomingWebhookIntegration
. The unique Webhook URL this integration creates can be used to post information into any resource that is associated with the integration. In this example, this integration is used in the resource namedMyIncomingWebhookResource
. To trigger theExampleStep
step, the resourceMyIncomingWebhookResource
is used as an input resource in the step.The Pipelines DSL for this example is available in this repository in the JFrog GitHub account.
resources: - name: MyIncomingWebhookResource type: IncomingWebhook configuration: webhookName: MyIncomingWebhookIntegration pipelines: - name: ExamplePipeline steps: - name: ExampleStep type: Bash configuration: inputResources: - name: MyIncomingWebhookResource execution: onExecute: - echo "$res_MyIncomingWebhookResource_payload" | jq '.' > payload.json - read_json payload.json "LESSER_SECRET_FORMULA"