Use the Webhook plugin to notify services via Webhook when a build completes. You will need to supply Drone with outgoing Webhook URLs. The below pipeline configuration demonstrates simple usage:

pipeline:
  webhook:
    image: plugins/webhook
    urls: http://requestbin.fullcontact.com/...

Authentication

It's often required to authenticate webhook requests to avoid malicious third-parties to flood the webhook endpoint. The Webhook plugin supports sending Basic Authentication information with the webhook request:

pipeline:
  webhook:
    image: plugins/webhook
    urls: http://requestbin.fullcontact.com/...
    secretFrom:
      WEBHOOK_USERNAME:
        name: webhook-secret-name
        keyRef: username
      WEBHOOK_PASSWORD:
        name: webhook-secret-name
        keyRef: password

Templating

You can customize the content of the webhook request using the template parameter:

pipeline:
  webhook:
    image: plugins/webhook
    urls: http://requestbin.fullcontact.com/...
    content_type: application/json
    template: |
      {
        "owner": "{{ .DRONE_REPO_OWNER }}",
        "repo": "{{ .DRONE_REPO_NAME }}",
        "status": "{{ .DRONE_BUILD_STATUS }}"
      }

Note

Compared to the original Drone Webhook plugin, templates are evaluated one step earlier (by Drone itself), so instead of the original template variables you can use environment variables. Read more about templating here.

Secret Reference

parameter description
WEBHOOK_USERNAME authenticates with this username
WEBHOOK_PASSWORD authenticates with this password

Read more how to attach secrets to CI/CD.

Parameter Reference

parameter required description
urls yes Payload gets sent to this list of URLs
username no Username for basic auth
password no Password for basic auth
method no HTTP submission method, defaults to POST
content_type no Content type, defaults to application/json
template no Custom template for webhook
headers no Map of custom headers
skip_verify no Skip SSL verification
debug no Enable debug information