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

res_<resource-name>_webhookName_authTypeSelect hmac, basic, or authorization
res_<resource-name>_webhookName_secretSecret to use with hmac
res_<resource-name>_webhookName_usernameUsername to use to trigger the webhook
res_<resource-name>_webhookName_passwordPassword for the user
res_<resource-name>_webhookName_authorizationAuthorization 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

int_<integration-name>_authTypeSelect hmac, basic, or authorization
int_<integration-name>_secretSecret to use with hmac
int_<integration-name>_usernameUsername to use to trigger the webhook
int_<integration-name>_passwordPassword for the user
int_<integration-name>_authorizationAuthorization 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 named MyIncomingWebhookResourceTo trigger the ExampleStep step, the resource MyIncomingWebhookResource 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"