Skip to content

docs: expand slash command event filtering documentation#25898

Merged
pelikhan merged 3 commits intomainfrom
copilot/add-slash-command-scope-option
Apr 12, 2026
Merged

docs: expand slash command event filtering documentation#25898
pelikhan merged 3 commits intomainfrom
copilot/add-slash-command-scope-option

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

Default slash_command triggers generate listeners for all event types, causing skipped runs in the Actions UI for workflows that only apply to specific contexts (e.g., issue-only bug investigation pipelines).

The events: field already exists but the docs underexplained the motivation and usage patterns.

Changes

  • reference/command-triggers.md: Expanded "Filtering Command Events" with:
    • Motivation explaining the skipped-run noise problem
    • Compact supported events list
    • Concise issue-only and PR-only yaml examples (no permissions or full frontmatter)
    • Note clarifying issue_comment vs pull_request_comment mapping
  • reference/triggers.md: Added inline events: example to the slash_command: section so the feature is discoverable without navigating to the full reference

Example

on:
  slash_command:
    name: investigate
    events: [issues, issue_comment]  # Only issue contexts — no PR-triggered skipped runs

Expand the "Filtering Command Events" section in command-triggers.md with:
- Motivation explaining the noise problem from default all-events triggers
- Structured table of all supported event identifiers
- Issue-only example workflow for bug investigation pipelines
- PR-only example workflow
- Note about pull_request_comment vs issue_comment mapping

Also expand the slash_command section in triggers.md with an inline
event filtering example.

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f6fde4fd-e1f4-46de-a141-0553f9fdd303

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add scope option to slash_command for event type restrictions docs: expand slash command event filtering documentation Apr 12, 2026
Copilot AI requested a review from pelikhan April 12, 2026 10:14
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot unbloat added docs, do not recommend permissions write

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 12, 2026

@copilot unbloat added docs, do not recommend permissions write

Trimmed in b294b2e — replaced full-workflow examples with concise yaml-only snippets, removed all permissions blocks (including issues: write), and condensed the supported events from a table to a single line.

@pelikhan pelikhan marked this pull request as ready for review April 12, 2026 10:38
Copilot AI review requested due to automatic review settings April 12, 2026 10:38
@pelikhan pelikhan merged commit b1c9b4e into main Apr 12, 2026
3 checks passed
@pelikhan pelikhan deleted the copilot/add-slash-command-scope-option branch April 12, 2026 10:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Expands documentation around slash_command.events to explain why and how to filter command-trigger contexts, reducing skipped-run noise in the GitHub Actions UI.

Changes:

  • Adds an inline events: example to the slash_command: section in the triggers reference.
  • Expands “Filtering Command Events” in the command triggers reference with motivation, supported events, concise examples, and an issue_comment vs pull_request_comment mapping note.
Show a summary per file
File Description
docs/src/content/docs/reference/triggers.md Adds a discoverable events: example under slash_command: to encourage context filtering.
docs/src/content/docs/reference/command-triggers.md Expands event filtering docs with motivation, supported events list, mapping note, and shorter examples.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

docs/src/content/docs/reference/command-triggers.md:105

  • The section title “Example command workflow” is followed by yaml snippets that only show an on: block (not a complete workflow markdown/frontmatter example). Consider renaming the heading to reflect that these are event-filtering examples/config snippets, or switch the examples back to a full aw workflow format if “workflow” is meant literally.
### Example command workflow

Issue-only command (avoids skipped runs from PR events):

```yaml wrap
  • Files reviewed: 2/2 changed files
  • Comments generated: 2

The `slash_command:` trigger creates workflows that respond to `/command-name` mentions in issues, pull requests, and comments. See [Command Triggers](/gh-aw/reference/command-triggers/) for complete documentation including event filtering, context text, reactions, and examples.
The `slash_command:` trigger creates workflows that respond to `/command-name` mentions in issues, pull requests, and comments.

By default, command triggers listen to **all** comment-related events, which can create noise from skipped runs. Use the `events:` field to restrict where commands are active:
## Filtering Command Events

By default, command triggers respond to `/command-name` mentions in all comment-related contexts. Use the `events:` field to restrict where commands are active:
By default, command triggers listen to all comment-related events, which can create skipped runs in the Actions UI. Use the `events:` field to restrict where commands are active:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

slash_command: scope option to restrict trigger event types

3 participants