Skip to content

Improve labeler patterns and fix duplicate workflow triggers#796

Merged
raman325 merged 9 commits into
mainfrom
fix/breaking-change-label
Jan 15, 2026
Merged

Improve labeler patterns and fix duplicate workflow triggers#796
raman325 merged 9 commits into
mainfrom
fix/breaking-change-label

Conversation

@raman325

@raman325 raman325 commented Jan 15, 2026

Copy link
Copy Markdown
Owner

Proposed change

  1. Breaking change label detection - Adds regex patterns to detect when the "# Breaking change" section contains actual content (in addition to the existing checkbox detection)

  2. Fix duplicate workflow runs - Removes redundant pull_request trigger from repository.yaml, keeping only pull_request_target which provides write permissions needed for fork PRs

Breaking change pattern design:

  • Uses ^[\s\S]*? to find FIRST # Breaking change from body start
  • Requires content to start with capitalized word ([A-Z][a-z]+) for natural language
  • Requires ## Proposed change to appear AFTER - this ignores any mentions in code blocks since there's only one ## Proposed change in the body
  • Checkbox pattern requires - prefix to avoid matching inline code examples

Workflow fix:

  • pull_request + pull_request_target with same activity types caused duplicate runs
  • Now uses only pull_request_target which works for both fork and non-fork PRs
  • Auto-merge condition updated to check for pull_request_target

Type of change

  • Code quality improvements to existing code or addition of tests

Additional information

🤖 Generated with Claude Code

Adds a second pattern to detect breaking changes when the "Breaking
change" section in the PR template has actual content (text after
the HTML comment and before "## Proposed change").

This complements the existing checkbox detection, since the PR
template instructs users to fill in the breaking change section
with details when applicable.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 15, 2026 07:51
@github-actions github-actions Bot added breaking-change Pull requests that break existing functionality code-quality Pull requests that improve code quality labels Jan 15, 2026
Adds a second pattern that matches when the HTML comment template
is removed and content is added directly after the "# Breaking change"
header.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Anchor patterns with ^ to prevent matching "# Breaking change" text
that appears inside code blocks or elsewhere in the PR body.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@raman325 raman325 removed the breaking-change Pull requests that break existing functionality label Jan 15, 2026
@github-actions github-actions Bot added the breaking-change Pull requests that break existing functionality label Jan 15, 2026

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 aims to enhance breaking change detection in PR body content by adding regex patterns to identify when users fill in the "Breaking change" section of the PR template with actual content, complementing the existing checkbox-based detection.

Changes:

  • Added two new regex patterns to detect breaking changes based on PR template content
  • Added explanatory comments for the new patterns

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

Comment thread .github/issue-labeler.yml Outdated
Comment thread .github/issue-labeler.yml Outdated
Comment thread .github/issue-labeler.yml Outdated
Changes:
- Use \n# instead of ^ to require newline immediately before #
  (indented code blocks have spaces between newline and #)
- Require content to start with capitalized word + space ([A-Z][a-z]+\s)
  to match natural language, not regex patterns
- Require ## Proposed change at line start too

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@raman325 raman325 removed the breaking-change Pull requests that break existing functionality label Jan 15, 2026
@github-actions github-actions Bot added the breaking-change Pull requests that break existing functionality label Jan 15, 2026
raman325 and others added 2 commits January 15, 2026 03:00
Key insight: require ## Proposed change to appear AFTER the match.
Since ## Proposed change only appears once, any # Breaking change
in code blocks after it won't match (no ## Proposed change follows).

Pattern logic:
- ^[\s\S]*? finds FIRST # Breaking change (non-greedy from start)
- Requires content (capitalized word after header/comment)
- [\s\S]*?## Proposed change requires this header to follow

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The checkbox in the PR template is "- [x] Breaking change".
Requiring the "- " prefix prevents matching inline code examples
like `[x] Breaking change` in PR descriptions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@raman325 raman325 removed the breaking-change Pull requests that break existing functionality label Jan 15, 2026
@github-actions github-actions Bot added the breaking-change Pull requests that break existing functionality label Jan 15, 2026
raman325 and others added 2 commits January 15, 2026 12:29
* main:
  Bump astral-sh/setup-uv from 5 to 7 (#797)
  Bump prettier from 3.7.4 to 3.8.0 (#799)
Changes:
- Remove pull_request trigger (was causing duplicate runs with pull_request_target)
- Keep only pull_request_target for PR events (provides write permissions for fork PRs)
- Update auto-merge condition to check for pull_request_target
- Consolidate activity types to single line

The warnings about pull_request_target activity types are from an outdated
linter schema - the types are valid per GitHub's current documentation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@raman325 raman325 changed the title Add breaking change label detection from PR body section Improve labeler patterns and fix duplicate workflow triggers Jan 15, 2026
@github-actions github-actions Bot removed the breaking-change Pull requests that break existing functionality label Jan 15, 2026
All checkbox patterns now require the "## Type of change" header to
appear first, preventing matches on checkbox examples elsewhere in
the PR body (like in code blocks or descriptions).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@raman325 raman325 requested a review from Copilot January 15, 2026 17:36
@raman325 raman325 merged commit 2e08dea into main Jan 15, 2026
15 checks passed
@raman325 raman325 deleted the fix/breaking-change-label branch January 15, 2026 17:38

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


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

@raman325 raman325 added the github-config Changes to .github/ configuration files label 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