Webhook

by drone-plugins

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:

steps:
- name: send
  image: plugins/webhook
  settings:
    urls: https://your.webhook/...

Example configuration with multiple URLs:

steps:
- name: send
  image: plugins/webhook
  settings:
    urls:
      - https://your.webhook/...
      - https://your.other.webhook/...

Example configuration with Basic Authentication:

steps:
- name: send
  image: plugins/webhook
  settings:
    username: myusername
    password: mypassword
    urls: https://your.webhook/...

Example configuration using secrets: (Note: tokens can be passed as passwords like this)

steps:
- name: send
  image: plugins/webhook
  settings:
    username:
      from_secret: myusername
    password:
      from_secret: mypassword
    urls: https://your.webhook/...

Example configuration with custom body:

steps:
- name: send
  image: plugins/webhook
  settings:
    username: myusername
    password: mypassword
    urls: https://your.webhook/...
    content_type: application/json
    template: |
      {
        "owner": "{{ repo.owner }}",
        "repo": "{{ repo.name }}",
        "status": "{{ build.status }}",
      }

Example configuration to debug response:

steps:
- name: send
  image: plugins/webhook
  settings:
    username: myusername
    password: mypassword
    urls: https://your.webhook/...
    debug: true

Parameter Reference

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

这个网页有没有错误? 请让我们知道 或编辑 这个页面