From e4480af169cf18009add9a90aa3fd1eafd0c2568 Mon Sep 17 00:00:00 2001 From: kitsuyui Date: Tue, 9 Jun 2026 04:27:26 +0900 Subject: [PATCH] docs: document Mustache template variables for custom rule messages --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 1214ac5..1a3305c 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,16 @@ You can add your own rules with `additional-rules`. The value is a JSON array, a | `rule` | Yes | Regular expression pattern evaluated against the PR number or commit SHA | | `message` | Yes | Mustache template rendered into the comment when the rule matches | +### Template variables + +The following Mustache variables are available in `message`, depending on `kind`: + +| Variable | Available when | Description | +| --- | --- | --- | +| `{{prNum}}` | `kind: "pr"` | Pull request number as a string | +| `{{commitId}}` | `kind: "commit"` | Commit SHA | +| `{{matched}}` | both | First capture of `rule` matched against the target value | + For example, this rule celebrates any commit SHA containing `1`. ```yaml