-
Notifications
You must be signed in to change notification settings - Fork 9
ci: Add workflow to label PRs with merge conflicts #265
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
WalkthroughIntroduces a GitHub Actions workflow that automatically detects and labels merge conflicts in pull requests. The workflow triggers on pushes to master and v\*-dev branches, and on pull request events, using a third-party action to flag conflicting PRs with metadata and informational comments. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| - master | ||
| - 'v*-dev' | ||
| pull_request_target: | ||
| types: [opened, synchronize, reopened] |
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.
I think synchronize does all these
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.
@coderabbitai is this true?
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.
🧩 Analysis chain
🌐 Web query:
GitHub Actions pull_request_target event types opened synchronize reopened
💡 Result:
Short answer
- The pull_request_target event supports the same pull-request activity types (opened, synchronize, reopened, plus others like labeled, edited, closed, etc.). By default workflows run for types opened, synchronize and reopened. [1][2]
Example (explicit types)
on:
pull_request_target:
types: [opened, synchronize, reopened]
Important notes
- pull_request_target runs in the context of the base branch (can access repo secrets) and will run even if the PR has merge conflicts — but it has security risks when running untrusted PR code. [1]
- If you omit types, GitHub defaults to opened, synchronize, reopened. [1][3]
Sources
[1] GitHub Actions — Events that trigger workflows (pull_request_target).
[2] GitHub Actions — Events that trigger workflows (pull_request).
[3] GitHub developer docs — PullRequestEvent (actions like opened, synchronize, reopened).
@PastaPastaPasta No, that's not true. opened, synchronize, and reopened are three distinct event types:
opened: Triggers when a PR is first createdsynchronize: Triggers when new commits are pushed to an existing PR branchreopened: Triggers when a previously closed PR is reopened
For a merge conflict checker, you need all three to catch conflicts at different stages of the PR lifecycle.
Note: If you omit the types field entirely, GitHub defaults to [opened, synchronize, reopened], so you could simplify to:
pull_request_target:But that's different from using only synchronize, which would miss conflicts on newly opened or reopened PRs.
|
LGTM pretty much the same as we have in core |
Just adds a workflow to label conflicting PRs.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.