Outgoing Webhook Integration

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

An Outgoing Webhook Integration is used by JFrog Pipelines to send webhook to an external system to trigger events on that system.

Creating a 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

  • Webhook URL -- URL of endpoint to receive the payload

  • Authorization Type -

    select hmac, basic, or authorization

  • Secret -- secret to use with hmac authType

  • User Name -- username to use with basic authType for invoking the webhook

  • Password -- password for the user to use with basic authType

  • Authorization -- authorization to use with authorization authType for invoking the webhook in the external system

Usage

Outgoing Webhook integration can be used in the Outgoing Webhook resource.

The Outgoing 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_webhookURL

Webhook URL to receive the outgoing payload

res_<resource-name>_webhookName_authType

AuthType: hmac, basic, or authorization

res_<resource-name>_webhookName_secret

Secret to use with hmac

res_<resource-name>_webhookName_username

Username to use for invoking the webhook

res_<resource-name>_webhookName_password

Password for the user

res_<resource-name>_webhookName_authorization

Authorization to use for invoking 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>_webhookURL

Webhook URL to receive the outgoing payload

int_<integration-name>_authType

AuthType: hmac, basic, or authorization

int_<integration-name>_secret

Secret to use with hmac

int_<integration-name>_username

Username to use for invoking the webhook

int_<integration-name>_password

Password for the user

int_<integration-name>_authorization

Authorization to use for invoking the webhook

Example

  • This example uses an Outgoing Webhook Integration named MyOutgoingWebhookIntegration, which is used in the resource named My_OutHook_formurl_Resource. The step my_send_hook_formurl uses this resource as an output resource to send a payload to the endpoint specified in the integration.

  • The Pipelines DSL for this example is available in this repository in the JFrog GitHub account.

Outgoing Form URL Webhook

resources:
  - name: My_OutHook_formurl_Resource
    type: OutgoingWebhook
    configuration:
      webhookName: MyOutgoingWebhookIntegration
      path: /url
      headers:
        content-type: application/x-www-form-urlencoded

pipelines:
  - name: ExamplePipeline
    steps:
      - name: my_send_hook_formurl
        type: Bash
        configuration:
          outputResources:
            - name: My_OutHook_formurl_Resource
        execution:
          onExecute:
            - echo "hello world"
            - formUrlEncodedPayload="foo=bar&runNumber=$run_number&stepName=$step_name"
            - set_payload My_OutHook_formurl_Resource "$formUrlEncodedPayload"