Skip to content

HookRun v1.1.0

Choose a tag to compare

@bluvenr bluvenr released this 11 Jun 12:20
· 21 commits to main since this release

✨ 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