-
Notifications
You must be signed in to change notification settings - Fork 11
Fix breaking-change label pattern to use OR logic #802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The github/issue-labeler action requires ALL patterns in an array to match (AND logic). Our previous config had three separate patterns that were mutually exclusive, so the label was never applied. Changed to use regex alternation (|) within a single pattern for OR logic: match either the checked checkbox OR a section with content. Also added a comment documenting this AND vs OR behavior to prevent future confusion. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical bug in the breaking-change label auto-detection pattern. The previous configuration used AND logic (multiple array items) for mutually exclusive patterns, preventing the label from ever being applied. The fix correctly uses regex alternation (OR logic) within a single pattern.
Changes:
- Replaced three mutually exclusive patterns with a single pattern using regex alternation (
|) for OR logic - Added documentation explaining AND vs OR logic behavior in the issue-labeler configuration
- Updated the breaking-change pattern to match the same structure as other label patterns (starting with "## Type of change")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use case-insensitive character classes [Bb]reaking [Cc]hange for consistency with other patterns - Add whitespace flexibility to section header pattern to handle Windows line endings and extra spaces Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The pattern now skips over the optional HTML comment from the PR template, so copy-pasting the template without adding content won't trigger the breaking-change label. Only actual content after the header (or after the comment) will match. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use YAML >- (folded block scalar) to write regex across multiple lines that map to the document structure - Add detailed comments explaining each part of the regex pattern - Pattern breakdown shows how it matches PR template sections - Line breaks become spaces, making the regex easier to understand Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously only matched .github/workflows/**, now matches all files under .github/ including labeler configs, templates, etc. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Better reflects the broader scope - now covers all .github/ files (workflows, labeler configs, templates, etc.) not just actions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Proposed change
Fix the
breaking-changelabel pattern inissue-labeler.ymlto use regex alternation (OR logic) instead of separate array items (AND logic).The Problem
The
github/issue-labeleraction requires ALL patterns in an array to match for a label to be applied. Our previous config had three separate patterns:These patterns are mutually exclusive (lowercase
[x]vs uppercase[X]), so the label was never applied.The Solution
Use regex alternation (
|) within a single pattern for OR logic:This matches either:
Testing
Verified with Node.js that the pattern correctly:
Type of change
Additional information
🤖 Generated with Claude Code