Skip to content

Support comma-separated label names in trigger syntax parser#7169

Merged
pelikhan merged 5 commits intomainfrom
copilot/add-command-separate-label-support
Dec 21, 2025
Merged

Support comma-separated label names in trigger syntax parser#7169
pelikhan merged 5 commits intomainfrom
copilot/add-command-separate-label-support

Conversation

Copy link
Contributor

Copilot AI commented Dec 21, 2025

The trigger syntax parser now accepts comma-separated label names in addition to space-separated format.

Changes

  • Parser Enhancement: Modified parseLabelTriggerShorthand() to split tokens on commas, enabling formats like issue labeled bug, enhancement alongside the existing issue labeled bug enhancement

  • Test Coverage: Added test cases for comma-separated labels (with/without spaces, mixed formats) across all entity types (issues, pull_request, discussion)

  • Fuzz Test Fix: Updated expandLabelTriggerShorthand fuzz test to correctly validate that discussion entities don't include the names field (per GitHub Actions spec)

Examples

All formats compile to the same output:

# Space-separated (existing)
on: issue labeled bug enhancement priority-high

# Comma-separated with spaces (new)
on: issue labeled bug, enhancement, priority-high

# Comma-separated without spaces (new)
on: issue labeled bug,enhancement,priority-high

Compiles to:

on:
  issues:
    types: [labeled]
    names:
      - bug
      - enhancement
      - priority-high
Original prompt

The trigger syntax parser should also support command separate list of label names (comma optional and removed)

on: issue labeled name1, name2, ...


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits December 21, 2025 21:19
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…tity correctly

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for command separate list of label names Support comma-separated label names in trigger syntax parser Dec 21, 2025
Copilot AI requested a review from pelikhan December 21, 2025 21:34
@pelikhan pelikhan marked this pull request as ready for review December 21, 2025 21:35
@pelikhan pelikhan merged commit d78a604 into main Dec 21, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/add-command-separate-label-support branch December 21, 2025 21:35
github-actions bot added a commit that referenced this pull request Dec 21, 2025
Add documentation for the new shorthand label trigger syntax that supports:
- Basic format: on: issue labeled bug
- Space-separated labels: on: issue labeled bug enhancement
- Comma-separated labels: on: issue labeled bug, enhancement

Covers features from PRs #7153, #7160, and #7169.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

2 participants