Incoming Webhook Integration

JFrog Pipelines Documentation

ft:sourceType
Paligo

An Incoming Webhook Integration is used to receive a webhook from an external system (for example, GitHub) to trigger a pipeline step.

Creating an Incoming Webhook 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.

incoming_webhook_1a.png

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_authType

Select hmac, basic, or authorization

res_<resource-name>_webhookName_secret

Secret to use with hmac

res_<resource-name>_webhookName_username

Username to use to trigger the webhook

res_<resource-name>_webhookName_password

Password for the user

res_<resource-name>_webhookName_authorization

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

int_<integration-name>_authType

Select hmac, basic, or authorization

int_<integration-name>_secret

Secret to use with hmac

int_<integration-name>_username

Username to use to trigger the webhook

int_<integration-name>_password

Password for the user

int_<integration-name>_authorization

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 named MyIncomingWebhookResource. To trigger the ExampleStepstep, 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"