Skip to content

Webhook config for gitea

With matching by Gitea IP and Secret value Tested with Gitea 1.21.3, webhook 2.8.0-4+b6

Example: /etc/webhook/hooks.yml

- command-working-directory: /opt/webhook
  execute-command: /opt/webhook/script-hook1.sh
  id: hook1
  trigger-rule-mismatch-http-response-code: 406 ### or other value
  trigger-rule:
    and:
    - match: 
        ip-range: "YOUR_GITEA_IP/32"
        type: ip-whitelist
    - match:
        parameter: 
            name: X-Gitea-Signature
            source: header
        secret: "YOUR_VALUE"
        type: payload-hmac-sha256
    - match:
        parameter: 
            name: Authorization
            source: header
        type: value
        value: "YOUR_VALUE"

See full config in ansible repo.