Cloud customer?
Start for Free >
Upgrade in MyJFrog >
What's New in Cloud >

Search





Overview

An IncomingWebhook resource can trigger one or more jobs in your pipeline whenever the associated URL is called using the HTTP POST method. 


When an IncomingWebhook resource is created with an Incoming Webhook Integration, it can be specified as an input to any step in that step's inputResources section. By default, any incoming payload from the webhook will trigger execution of the step, but this can be changed by setting trigger to false.

Any JSON payload passed in by the received POST call will be stored in the payload property of the resource. The step can access the JSON payload through the res_<resource_name>_payload environment variable. The value of the environment variable can be written to a file, and individual elements can be read from that file using the read_json utility function.

When using Webhook as an output resource, you can construct the outgoing payload through the write_output utility function to add key/value pairs.

You can use an IncomingWebhook resource to trigger execution of another pipeline. When specified as an output resource of a step in one pipeline and an input resource of a step in a different pipeline, setting a payload for the IncomingWebhook in the first step will trigger execution of the other step. In this way, completion of a step in one pipeline can trigger execution of a different pipeline.


Page Contents

Usage

resources:
  - name: 		<string>
    type: 		IncomingWebhook
    configuration:
      webhookName: 	<string>

Tags

name 

An alphanumeric string (underscores are permitted) that identifies the resource.

type 

Must be IncomingWebhook for this resource type.

configuration

Specifies all configuration selections for the resource.

Tag

Description

Required/Optional
webhookNameThe name of an Incoming Webhook IntegrationRequired

Environment Variables

Whenever IncomingWebhook is used in a step, a set of environment variables is automatically made available that you can use in your step.

Environment Variable

Description

res_<resource_name>_name
Name of the resource
res_<resource_name>_payload
Webhook payload that was received in the incoming POST or created by the step for output

Example

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"
  • No labels
Copyright © 2021 JFrog Ltd.