diff --git a/docs/src/content/docs/reference/triggers.md b/docs/src/content/docs/reference/triggers.md index 6dea57d493..011fa2d601 100644 --- a/docs/src/content/docs/reference/triggers.md +++ b/docs/src/content/docs/reference/triggers.md @@ -348,6 +348,49 @@ on: This filtering is especially useful for [LabelOps workflows](/gh-aw/examples/issue-pr-events/labelops/) where specific labels trigger different automation behaviors. +#### Shorthand Syntax for Label Triggers + +GitHub Agentic Workflows provides convenient shorthand syntax for label-based triggers: + +**Basic format:** +```yaml wrap +on: issue labeled bug +``` + +**Multiple labels (space-separated):** +```yaml wrap +on: issue labeled bug enhancement priority-high +``` + +**Multiple labels (comma-separated):** +```yaml wrap +on: issue labeled bug, enhancement, priority-high +``` + +**With explicit item type:** +```yaml wrap +on: pull_request labeled needs-review, ready-to-merge +``` + +All shorthand formats compile to the standard GitHub Actions syntax: + +```yaml wrap +on: + issues: # or pull_request + types: [labeled] + names: + - bug + - enhancement + - priority-high +``` + +**Supported entity types:** +- `issue labeled ` - Issue label events +- `pull_request labeled ` - Pull request label events +- `discussion labeled ` - Discussion label events (GitHub Actions doesn't support `names` for discussions, so only the `types` filter is applied) + +The shorthand syntax automatically includes `workflow_dispatch` trigger, similar to how `on: daily` expands to include both schedule and workflow_dispatch. + ### Reactions (`reaction:`) An additional option `reaction:` is available within the `on:` section to enable emoji reactions on the triggering GitHub item (issue, PR, comment, discussion) to provide visual feedback about the workflow status: