Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion docs/src/content/docs/reference/safe-outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ safe-outputs:

#### Auto-Expiration

The `expires` field auto-closes issues after a time period. Supports integers (days), relative formats (`2h`, `7d`, `2w`, `1m`, `1y`), or `false` to disable expiration. Generates `agentics-maintenance.yml` workflow that runs at the minimum required frequency based on the shortest expiration time across all workflows:
The `expires` field auto-closes issues after a time period. Supports day-string format (`7d`, `2w`, `1m`, `1y`, `2h`) or `false` to disable expiration. Integer values (e.g., `expires: 7`) are also accepted as shorthand for days and can be migrated to string format with `gh aw fix --write`. Generates `agentics-maintenance.yml` workflow that runs at the minimum required frequency based on the shortest expiration time across all workflows:
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording: this calls the preferred format "day-string" but the examples include 2h, which isn’t a day-string. Consider describing the preferred values as a duration string (e.g., 2h, 7d, 2w, 1m, 1y) to avoid implying only day-based suffixes are supported.

Suggested change
The `expires` field auto-closes issues after a time period. Supports day-string format (`7d`, `2w`, `1m`, `1y`, `2h`) or `false` to disable expiration. Integer values (e.g., `expires: 7`) are also accepted as shorthand for days and can be migrated to string format with `gh aw fix --write`. Generates `agentics-maintenance.yml` workflow that runs at the minimum required frequency based on the shortest expiration time across all workflows:
The `expires` field auto-closes issues after a time period. Supports duration string format (`2h`, `7d`, `2w`, `1m`, `1y`) or `false` to disable expiration. Integer values (e.g., `expires: 7`) are also accepted as shorthand for days and can be migrated to string format with `gh aw fix --write`. Generates `agentics-maintenance.yml` workflow that runs at the minimum required frequency based on the shortest expiration time across all workflows:

Copilot uses AI. Check for mistakes.

- 1 day or less → every 2 hours
- 2 days → every 6 hours
Expand Down Expand Up @@ -1241,6 +1241,37 @@ safe-outputs:
- `["repo", "owner/other-repo"]` - Allow specific repositories
- Not specified (default) - All references allowed

### Bot Mention Limit (`max-bot-mentions:`)

Agent output is automatically scanned for bot trigger phrases (e.g., `@copilot`, `@github-actions`) to prevent accidental automation triggering. By default, the first 10 occurrences are left unchanged and any excess are escaped with backticks. Entries already wrapped in backticks are skipped.

Comment on lines +1246 to +1247
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The examples here describe bot trigger phrases as @copilot / @github-actions, but the current sanitization logic neutralizes issue/PR auto-close keywords like fixes #123 / closes #123 / resolves #123 (see actions/setup/js/sanitize_content_core.cjs). Please update the examples to match what is actually being escaped so users know what max-bot-mentions affects.

This issue also appears on line 1256 of the same file.

Copilot uses AI. Check for mistakes.
Use `max-bot-mentions` to adjust this threshold:

```yaml wrap
safe-outputs:
max-bot-mentions: 3 # Allow 3 unescaped bot mentions per output
create-issue:
```

Accepts a literal integer or a GitHub Actions expression string (e.g., `${{ inputs.max-mentions }}`). Set to `0` to escape all bot trigger phrases. Default: 10.

### Templatable Fields

`max`, `expires`, and `max-bot-mentions` accept GitHub Actions expression strings in addition to literal integers, allowing workflow inputs or repository variables to control limits at runtime:

```yaml wrap
safe-outputs:
max-bot-mentions: ${{ inputs.max-mentions }}
create-issue:
max: ${{ inputs.max-issues }}
expires: ${{ inputs.expires-days }}
create-pull-request:
max: ${{ inputs.max-prs }}
draft: ${{ inputs.create-draft }}
```

Most boolean configuration fields also accept expression strings. Fields that influence permission computation (such as `add-comment.discussion` and `create-pull-request.fallback-as-issue`) remain literal booleans.
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name in this example appears to be incorrect. In the current config/types, the add-comment permission-affecting flag is add-comment.discussions (plural) (see pkg/workflow/add_comment.go). Using add-comment.discussion here will confuse readers and may not match schema validation.

Suggested change
Most boolean configuration fields also accept expression strings. Fields that influence permission computation (such as `add-comment.discussion` and `create-pull-request.fallback-as-issue`) remain literal booleans.
Most boolean configuration fields also accept expression strings. Fields that influence permission computation (such as `add-comment.discussions` and `create-pull-request.fallback-as-issue`) remain literal booleans.

Copilot uses AI. Check for mistakes.

### Maximum Patch Size (`max-patch-size:`)

Limits git patch size for PR operations (1-10,240 KB, default: 1024 KB):
Expand Down
2 changes: 2 additions & 0 deletions docs/src/content/docs/setup/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ gh aw fix --list-codemods # List available codemods

**Options:** `--write`, `--list-codemods`

Notable codemods include `expires-integer-to-string`, which converts bare integer `expires` values (e.g., `expires: 7`) to the preferred day-string format (e.g., `expires: 7d`) in all `safe-outputs` blocks. Run `gh aw fix --list-codemods` to see all available codemods.

#### `compile`

Compile Markdown workflows to GitHub Actions YAML. Remote imports cached in `.github/aw/imports/`.
Expand Down