JFrog Custom Webhooks use a similar payload templating to Golang text templates, but are limited in that they only support two actions. In payloads, you can:
Display dynamic scalar values by rendering a textual representation for the variables: For example,
{{ variable_name }}
.Use
json
oryaml
functions on an object to convert them into JSON or YAML format, to prepare the object for transmission or storage. For example,{{ json object_name }}
.
Two root objects are supported: data and secrets.
Root Object | Description | Example |
---|---|---|
| An object containing the payload specific to the event, as defined in Event Types. |
In a “build promoted” event, this will contain the build name. |
| An object containing all the secrets you have defined for this webhook. |
This will render the secret name |
Example
To create a custom webhook to automate Kubernetes deployments as part of this workflow, you can use this payload template:
{ "event_type" : "hot-deploy", "client_payload" : { "tag" : "{{ .data.tag }}" } }