diff --git a/docs/src/content/docs/reference/footers.md b/docs/src/content/docs/reference/footers.md index ae8f0f93c9d..ce9026b7d55 100644 --- a/docs/src/content/docs/reference/footers.md +++ b/docs/src/content/docs/reference/footers.md @@ -42,6 +42,41 @@ safe-outputs: Individual handler settings always take precedence over the global setting. +## PR Review Comment Footer Control + +For PR review comments (`create-pull-request-review-comment`), the `footer` field supports additional conditional control: + +```yaml wrap +safe-outputs: + create-pull-request-review-comment: + footer: "if-body" # conditional footer based on review body + submit-pull-request-review: +``` + +The `footer` field accepts three string values: + +- `"always"` (default) - Always include footer on review comments +- `"none"` - Never include footer on review comments +- `"if-body"` - Only include footer when the review has body text + +Boolean values are also supported and automatically converted: +- `true` → `"always"` +- `false` → `"none"` + +This is particularly useful for clean approval reviews without body text. With `footer: "if-body"`, approval reviews appear clean without the AI-generated footer, while reviews with explanatory text still include the footer for attribution. + +**Example use case - Clean approvals:** + +```yaml wrap +safe-outputs: + create-pull-request-review-comment: + footer: "if-body" # Show footer only when review has body + submit-pull-request-review: + max: 1 +``` + +When the agent submits an approval without a body (just "APPROVE" event), no footer appears. When the agent includes explanatory comments in the review body, the footer is included. + ## What's Preserved When Footer is Hidden Even with `footer: false`, the following are still included: diff --git a/docs/src/content/docs/reference/safe-outputs.md b/docs/src/content/docs/reference/safe-outputs.md index 2fa0f91e304..431c507a847 100644 --- a/docs/src/content/docs/reference/safe-outputs.md +++ b/docs/src/content/docs/reference/safe-outputs.md @@ -685,8 +685,32 @@ safe-outputs: side: "RIGHT" # "LEFT" or "RIGHT" (default: "RIGHT") target: "*" # "triggering" (default), "*", or number target-repo: "owner/repo" # cross-repository + footer: "if-body" # footer control: "always", "none", or "if-body" ``` +#### Footer Control for Review Comments + +The `footer` field controls whether AI-generated footers are added to PR review comments: + +- `"always"` (default) - Always include footer on review comments +- `"none"` - Never include footer on review comments +- `"if-body"` - Only include footer when the review has a body text + +You can also use boolean values which are automatically converted: +- `true` → `"always"` +- `false` → `"none"` + +This is particularly useful for clean approval reviews without body text, where you want to avoid footer noise: + +```yaml wrap +safe-outputs: + create-pull-request-review-comment: + footer: "if-body" # Only show footer when review has body text + submit-pull-request-review: +``` + +With `footer: "if-body"`, approval reviews without body text appear clean without the AI-generated footer, while reviews with explanatory text still include the footer for attribution. + ### Submit PR Review (`submit-pull-request-review:`) Submits a consolidated pull request review with a status decision. All `create-pull-request-review-comment` outputs are automatically collected and included as inline comments in the review.