feat: custom webhook payload templates and passthrough mode - #112
Open
abrugh wants to merge 2 commits into
Open
Conversation
Add 'custom' and 'passthrough' webhook notification formats.
Custom templates use {{placeholder}} syntax with variables:
subject, body, job_name, status, execution_id, stdout, stderr, timestamp.
Passthrough mode sends script stdout directly as the HTTP payload,
enabling scripts to craft their own webhook-ready JSON.
UI adds template textarea with Discord/Slack/signal-cli presets.
Existing formats (slack, teams, pagerduty, discord, generic) unchanged.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…advisory h2 0.4.14 has an unbounded empty DATA frames vulnerability (fixed in 0.4.16); the bump is lockfile-only and compatible with hyper 1.10.1. smartstring (transitive dep of rhai) was archived upstream with no safe upgrade available (RUSTSEC-2026-0249); ignored with a documented reason and a re-evaluation date until rhai is replaced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #80
Summary
Replaces the rigid hardcoded format handlers in
send_webhook()with a user-defined JSON template system, so new webhook targets no longer require code changes.customformat — user-defined template with{{placeholder}}substitution:{{subject}},{{body}},{{job_name}},{{status}},{{execution_id}},{{stdout}},{{stderr}},{{timestamp}}passthroughformat — the job's stdout is sent verbatim as the HTTP payload, letting scripts own the payload shape (e.g. rich Discord embeds, signal-cli JSON-RPC)Example: signal-cli JSON-RPC
{ "jsonrpc": "2.0", "method": "send", "params": {"recipient": ["+1234567890"], "message": "{{subject}}\n{{body}}"}, "id": 1 }Security job fixes (pre-existing on main — easy to split out)
The Security CI job was failing on main before this PR (new RUSTSEC advisories landed after the last green run). Two small, independent changes included here to get CI green:
Cargo.lock: h2 0.4.14 → 0.4.16 — fixes a real vulnerability (unbounded empty DATA frames). Lockfile-only; noCargo.tomlchange, no collision with the open hyper 1.11 dependabot PR.deny.toml: ignore RUSTSEC-2026-0249 (smartstring unmaintained) —deny.tomlhunk and the h2 bump can stand alone.Testing
cargo clippy --all-targets --all-featuresclean underRUSTFLAGS=-Dwarnings;cargo fmt --checkcleancargo deny checkgreen locally (advisories, bans, licenses, sources)Backward compatibility
No schema or behavior changes for existing configs —
templateis an optional field and the five existing formats take the exact same code paths as before.