Skip to content

Fix issue-labeler patterns to use portable cross-line matching#800

Merged
raman325 merged 1 commit into
mainfrom
fix/labeler-patterns
Jan 15, 2026
Merged

Fix issue-labeler patterns to use portable cross-line matching#800
raman325 merged 1 commit into
mainfrom
fix/labeler-patterns

Conversation

@raman325

@raman325 raman325 commented Jan 15, 2026

Copy link
Copy Markdown
Owner

Proposed change

Replace [\s\S]*? with (.|[\r\n])*? for matching across lines in issue-labeler patterns. The [\s\S] character class may not work in all regex engines, while (.|[\r\n]) is more portable.

This should fix the issue where checkbox patterns weren't matching PRs with breaking change checked.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

🤖 Generated with Claude Code

Replace [\s\S]*? with (.|[\r\n])*? for matching across lines.
The [\s\S] character class may not work in all regex engines,
while (.|[\r\n]) is more portable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 15, 2026 18:05
@raman325 raman325 merged commit ffd718c into main Jan 15, 2026
14 checks passed
@raman325 raman325 deleted the fix/labeler-patterns branch January 15, 2026 18:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the regex patterns in the issue-labeler configuration to use more portable cross-line matching syntax. The change replaces [\s\S]*? with (.|[\r\n])*? to ensure compatibility across different regex engines used by the github/issue-labeler action.

Changes:

  • Updated all regex patterns to use (.|[\r\n])*? instead of [\s\S]*? for cross-line matching
  • Updated comment to document the reasoning for the pattern choice

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

Comment thread .github/issue-labeler.yml
- '## Type of change(.|[\r\n])*?- \[[xX]\]\s*[Bb]reaking [Cc]hange'
# Breaking change section with content after HTML comment
- '^[\s\S]*?# Breaking change[\s\S]*?-->\s*\n+[A-Z][a-z]+[\s\S]*?## Proposed change'
- '# Breaking change(.|[\r\n])*?-->\s*\n+[A-Z][a-z]+(.|[\r\n])*?## Proposed change'

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

The pattern # Breaking change matches any line containing '# Breaking change', not just a section header. This could produce false positives if that text appears elsewhere in the PR body. The pattern should be anchored or more specific to match the actual section structure from the PR template.

Copilot uses AI. Check for mistakes.
Comment thread .github/issue-labeler.yml
- '# Breaking change(.|[\r\n])*?-->\s*\n+[A-Z][a-z]+(.|[\r\n])*?## Proposed change'
# Breaking change section with HTML comment removed
- '^[\s\S]*?# Breaking change\s*\n+[A-Z][a-z]+[\s\S]*?## Proposed change'
- '# Breaking change\s*\n+[A-Z][a-z]+(.|[\r\n])*?## Proposed change'

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

The pattern requires text starting with a capital letter followed by lowercase letters ([A-Z][a-z]+), but breaking change descriptions could start with various patterns (e.g., numbers, multiple capital letters, special characters). This is too restrictive and may miss valid breaking changes.

Copilot uses AI. Check for mistakes.
Comment thread .github/issue-labeler.yml
Comment on lines +16 to +18
- '# Breaking change(.|[\r\n])*?-->\s*\n+[A-Z][a-z]+(.|[\r\n])*?## Proposed change'
# Breaking change section with HTML comment removed
- '^[\s\S]*?# Breaking change\s*\n+[A-Z][a-z]+[\s\S]*?## Proposed change'
- '# Breaking change\s*\n+[A-Z][a-z]+(.|[\r\n])*?## Proposed change'

Copilot AI Jan 15, 2026

Copy link

Choose a reason for hiding this comment

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

Both breaking-change patterns require content between the breaking change section and the 'Proposed change' section to start with [A-Z][a-z]+. According to the PR template, users are expected to remove the breaking change section if not applicable. These patterns may not correctly identify breaking changes if users provide different content formats or simply check the checkbox without filling in the breaking change section.

Copilot uses AI. Check for mistakes.
@raman325 raman325 added code-quality Pull requests that improve code quality github_actions github-config Changes to .github/ configuration files labels Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality Pull requests that improve code quality github-config Changes to .github/ configuration files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants