Note
Custom webhooks were introduced in Artifactory 7.50.3.
From Artifactory 7.93, you can create webhooks associated with a specific project.
Select All Projects, or from the Projects list, select the specific project for which to create a webhook.
Select the Administration module, then General Management| Webhooks.
Navigate to Administration Module | General | Webhooks, if you use the classic navigation. Classic navigation is available for JFrog self-hosted customers with version 7.90 or previous only.
Click New Webhook.
Click the Custom toggle.
Enter the name and description of the webhook.
Enter the URL that the webhook invokes.
For example:
https://api.github.com/repos/myrepo/actions/workflows/artifact_deployed.yml/dispatches
Select the HTTP method that the webhook should use.
You can choose from
POST
,PUT
,GET
,PATCH
, andDELETE
. The default selection isPOST
.Prior to Artifactory version 7.80.0, custom webhooks could be used only the
POST
method like predefined webhooks.Select a proxy server from the list of configured proxy servers in the Use Proxy dropdown if you want to send the webhook through a proxy.
Applicable only for a self-hosted JFrog Platform installation
Select whether to show the results of the successful execution of the webhooks in the Troubleshooting tab.
Note
JFrog Cloud: Applicable only if Webhooks troubleshooting is available in your JFrog Cloud instance.
JFrog Self-hosted: Applicable only if you configured Webhooks Troubleshooting.
Select the events that should trigger the webhook.
Events drop-down lists the events in Artifactory, Xray, and Distribution that function as the event trigger for the Webhook.
You can select multiple events from the list.
You can apply certain events to repositories, builds, and Release Bundles.
Note
For a webhook associated with a specific project, event types are limited to those for Artifacts, Docker, Artifact Properties and Builds.
You can apply events such as
Artifact was deployed
,moved
, andadded
on every repository in Artifactory or on a list of specific repositories, based on a specific list or by using include/exclude patterns.Note
If you select any local and/or remote repository, the webhook is applied on all existing repositories and any repositories you create in the future.
You can apply events such as
build was deployed
,promoted
, anddeleted
on every new build that is uploaded to Artifactory or on a list of specific builds, based on a specific list or by using include/exclude patterns.You can apply Release Bundle and Distribution events on every new Release Bundle or on a list of specific Release Bundles, based on a specific list or by using include/exclude patterns.
Add secrets to the webhook if required.
Defines a set of sensitive values (such as, tokens and passwords) that can be injected in the headers and/or payload. The values of the secrets are encrypted.
Invoke the value In the header/payload using the
{{.secrets.token}}
format, wheretoken
is the name provided for the secret value.Click Add Secret to add more than one secret.
Note
It is possible to update the value of a secret (when a password changes, or a token expires) using the Update Webhook Subscription by Key REST API:
PUT /event/api/v1/subscriptions/<sub-key>/secrets/<secret-name>
Authorization: Bearer <admin token>
Content-Type: text/plain
<secret-value>
Add HTTP headers you wish to use to invoke the webhook.
Click Add Header to add more than one header.
Enter the custom payload that you want to send to the target service.
In the payload, you can invoke values using dotted-syntax.
Example
{ "ref": "main", "inputs": { "artifact_path": "{{.data.repo_key}}/{{.data.path}}" } }
To know what values can be injected in the payload (as well as in HTTP headers), see Event Types.
Click Test to test the configuration.
Sends a fake HTTP request to the target URL and verify that the webhook is working fine.
Click Create to save the webhook configuration.
Note
By default, private networks are not allowed to be used as Webhook targets for security reasons. If you would like to allow use of a private network, change the URL strict policy configuration in the
system.yaml
file:urlStrictPolicy: true
. See Artifactory System YAML.