Skip to content

Releases: bluvenr/hookrun

HookRun v1.1.0

11 Jun 12:20

Choose a tag to compare

✨ New Features

Template Variables

Actions (cmd / path / args) now support template variables resolved from the incoming request at runtime:

actions:
  - type: "command"
    cmd: "git checkout {{.body.ref}} && echo 'Event: {{.header.X-GitHub-Event}}'"
Template Source Example
{{.body.<path>}} JSON body {{.body.ref}}
{{.header.<name>}} Request header {{.header.X-GitHub-Event}}
{{.query.<name>}} URL query param {{.query.token}}

Body paths support dot notation and array indexing (same as filter body type).

pass_args — Extract & Append Parameters

Extract values from the request and append them as trailing arguments:

actions:
  - type: "command"
    cmd: "echo 'Deploying:'"
    pass_args:
      - { source: "body",   key: "ref" }
      - { source: "header", key: "X-GitHub-Event" }

Result when receiving {"ref":"refs/heads/main"} with header X-GitHub-Event: push:

echo 'Deploying:' "refs/heads/main" "push"

Enhanced validate Output

hookrun validate now shows the auth type configured for each rule config:

Rule files loaded: 1
    - github-auto-deploy (2 rules: push-to-main, tag-release) [auth: token+hmac]

🔧 Improvements

  • Shell argument quoting — pass_args values are properly quoted (double quotes on Windows, single quotes on Unix) to prevent injection
  • Raw body preservation — request body bytes are kept intact for both HMAC verification and template resolution

📝 Documentation

  • Added template variables and pass_args sections to Configuration Reference (EN/ZH)
  • Updated Usage Guide examples and health endpoint response (EN/ZH)
  • Updated Deployment Guide build command and health check example (EN/ZH)
  • Updated README Demo section and Actions example (EN/ZH)

Full Changelog: v1.0.1...v1.1.0

HookRun v1.0.0

11 Jun 11:22

Choose a tag to compare

HookRun v1.0.0

A lightweight webhook action engine — execute custom commands and scripts based on YAML rules.

Features

  • YAML-driven rules — Define all webhook behaviors through YAML config files, zero coding
  • Targeted routingPOST /webhook/{filename} directly routes to a specific config
  • Flexible authentication — Token (Header/Query) + IP whitelist with AND relationship
  • Multi-condition filters — Match against Header / Query / Body with operators: eq ne contains regex
  • Execution policiesblock (prevent concurrency), always (always execute), cooldown (rate limiting)
  • Policy inheritance — File-level defaults with per-rule overrides
  • Matching controlallow_all and first_match_only toggles
  • Hot reload — Reload all configs at runtime without restart
  • Log management — Daily rotation with configurable retention
  • Cross-platform — Single binary for Linux, macOS, and Windows

CLI

  • hookrun start [-f] Start server (daemon or foreground)
  • hookrun stop Stop server
  • hookrun restart Restart server
  • hookrun status Show running status
  • hookrun reload Hot-reload YAML configs
  • hookrun validate Validate all config files
  • hookrun version Show version info

Quick Start

hookrun validate
hookrun start

Install

# From source
go install github.com/bluvenr/hookrun/cmd/hookrun@v1.0.0

# Or build from source
git clone https://github.com/bluvenr/hookrun.git
cd hookrun
go build -o hookrun ./cmd/hookrun/