Skip to content

Add automated merge conflict labeling workflow#205

Open
dhruvi-16-me wants to merge 1 commit intoAOSSIE-Org:mainfrom
dhruvi-16-me:merge-conflict-label
Open

Add automated merge conflict labeling workflow#205
dhruvi-16-me wants to merge 1 commit intoAOSSIE-Org:mainfrom
dhruvi-16-me:merge-conflict-label

Conversation

@dhruvi-16-me
Copy link
Copy Markdown
Contributor

@dhruvi-16-me dhruvi-16-me commented Mar 3, 2026

Summary

This PR introduces an automated workflow that labels pull requests with merge conflicts using eps1lon/actions-label-merge-conflict.

When a PR has merge conflicts:

  • A label “PR has merge conflicts” is automatically added.
  • A comment is posted notifying the contributor.
  • The label is automatically removed once conflicts are resolved.

Why This Change?

Currently, maintainers must manually identify and notify contributors when their PR requires rebasing. This creates unnecessary review overhead and delays.

This workflow:

  • Improves PR triage visibility
  • Notifies contributors immediately when conflicts arise
  • Reduces manual maintainer intervention
  • Ensures PRs are conflict-free before review

Behavior

When merge conflicts appear:

  • Label added: PR has merge conflicts
  • Comment posted:

⚠️ This PR has merge conflicts.
Please resolve the merge conflicts before review.
Your PR will only be reviewed by a maintainer after all conflicts have been resolved.
Watch this video to understand why conflicts occur and how to resolve them.

When conflicts are resolved:

  • Label is automatically removed.

Testing

The full lifecycle was tested in an isolated test repository:

  • Conflict created → label + comment added
  • Conflict resolved → label removed
  • Subsequent base merges → re-check works correctly

Screenshots

Screenshot 2026-02-16 221209 Screenshot 2026-02-16 221254

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • Chores
    • Pull requests with merge conflicts are now automatically labeled and receive a notification comment to guide resolution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 3, 2026

📝 Walkthrough

Walkthrough

A new GitHub Actions workflow is introduced that automatically labels pull requests containing merge conflicts. The workflow triggers on push and pull_request_target events, using an external action to identify and label conflicted PRs with a designated label and comment.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/label-merge-conflicts.yml
New workflow that detects merge conflicts in PRs and applies the "PR has merge conflicts" label using eps1lon/actions-label-merge-conflict@v3 action, along with an instructional comment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A workflow hops into view,
Watching for conflicts, old and new,
With labels bright and warnings clear,
Merge disputes disappear from here! ✨
The rabbits' fix: automate the chore,
No more tangled branches to ignore! 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add automated merge conflict labeling workflow' directly and clearly describes the main change: introducing a new GitHub Actions workflow for automated merge conflict detection and labeling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/label-merge-conflicts.yml (1)

4-6: Scope the push trigger to your base branch.

Line 4 currently runs on every push. If the goal is re-checking PRs when base updates, limit it to the integration branch (for example main) to reduce unnecessary runs.

🎯 Proposed change
 on:
   push:
+    branches: [main]
   pull_request_target:
     types: [opened, reopened, synchronize]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/label-merge-conflicts.yml around lines 4 - 6, The
workflow's push trigger is currently unscoped; change the push trigger block to
restrict runs to the repo's base/integration branch (e.g., replace the top-level
"push:" with a push block that includes "branches: [main]") so pushes to other
branches won't trigger the job; leave the pull_request_target types as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/label-merge-conflicts.yml:
- Around line 17-20: Replace the mutable action tag used in the workflow (the
line containing "uses: eps1lon/actions-label-merge-conflict@v3") with a fixed
40-character commit SHA for that action; fetch the latest trusted commit SHA
from the upstream action repo, update the "uses" value to
"eps1lon/actions-label-merge-conflict@<full-commit-sha>", and keep the existing
inputs (dirtyLabel and repoToken) unchanged so the workflow behavior remains
identical while preventing silent upstream changes.

---

Nitpick comments:
In @.github/workflows/label-merge-conflicts.yml:
- Around line 4-6: The workflow's push trigger is currently unscoped; change the
push trigger block to restrict runs to the repo's base/integration branch (e.g.,
replace the top-level "push:" with a push block that includes "branches:
[main]") so pushes to other branches won't trigger the job; leave the
pull_request_target types as-is.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf2541b and def6b38.

📒 Files selected for processing (1)
  • .github/workflows/label-merge-conflicts.yml

@dhruvi-16-me
Copy link
Copy Markdown
Contributor Author

Hey @SharkyBytes Check this pr. Please merge.

@dhruvi-16-me
Copy link
Copy Markdown
Contributor Author

Hey @SharkyBytes I haven't raised an issue for this because it is approved by Bruno.

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.

1 participant