v1.1.0 — OPEN SOURCE

Webhook in,
action out.

A lightweight engine that executes custom commands and scripts based on YAML rules when webhook requests arrive. Single binary, cross-platform.

$hookrun validate
Validating config: config.yaml
PASS: All configurations are valid
Server port: 9000
Webhook route: /webhook
Rule files loaded: 1
- github-auto-deploy (2 rules) [auth: token]

$hookrun start
HookRun started in background (PID: 8421)

$curl -X POST .../webhook/github-auto-deploy \
  -H "X-GitHub-Event: push" -d '{"ref":"refs/heads/main"}'
{"code":200,"rule":"push-to-main","actions":3}

Capabilities

YAML Driven
All rules defined in YAML files. No code, no database — just config files in a directory.
Targeted Routing
/webhook/{filename} routes directly to a specific config file for precise, efficient matching.
Flexible Auth
Token verification, HMAC signatures (GitHub/GitLab), and IP whitelisting — combined with AND logic.
Multi-Condition Filters
Match against headers, query params, or JSON body with eq ne contains regex operators.
Execution Policies
block to prevent concurrency, always to run every time, cooldown for rate limiting.
Template Variables
Inject request data directly into commands with {{.body.ref}}, {{.header.X}}, and pass_args.
Hot Reload
Reload all YAML configurations at runtime via CLI — no restart, no downtime.
Single Binary
Written in Go. One binary for Linux, macOS, and Windows. No runtime dependencies.

Configuration

One YAML file per scenario. Filters match the request, actions execute the commands.

hooks/github-deploy.yaml
name: "github-auto-deploy" auth: hmac: header: "X-Hub-Signature-256" secret: "your-github-webhook-secret" execution: policy: "block" # prevent concurrent deploys rules: - name: "deploy-main" filters: - type: "header" key: "X-GitHub-Event" operator: "eq" value: "push" - type: "body" key: "ref" operator: "eq" value: "refs/heads/main" actions: - type: "command" cmd: "cd /var/www/app && git pull origin {{.body.ref}}" timeout: 120 - type: "command" cmd: "npm install --production && npm run build" timeout: 120

Quick Start

01
Build
git clone https://github.com/bluvenr/hookrun.git cd HookRun go build -o hookrun ./cmd/hookrun/
02
Configure
# Edit config.yaml and hooks/*.yaml hookrun validate
03
Run
hookrun start # daemon mode hookrun start -f # foreground