Skip to content

add merge conflict labelling workflow#8

Merged
Zahnentferner merged 1 commit into
StabilityNexus:mainfrom
SIDDHANTCOOKIE:feat/merge-conflict-labels
Mar 26, 2026
Merged

add merge conflict labelling workflow#8
Zahnentferner merged 1 commit into
StabilityNexus:mainfrom
SIDDHANTCOOKIE:feat/merge-conflict-labels

Conversation

@SIDDHANTCOOKIE

@SIDDHANTCOOKIE SIDDHANTCOOKIE commented Mar 24, 2026

Copy link
Copy Markdown
Member

Addressed Issues:

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.

Screenshots/Recordings:

TODO: If applicable, add screenshots or recordings that demonstrate the interface before and after the changes.

Additional Notes:

AI Usage Disclosure:

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. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • 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 Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • Chores
    • Enhanced pull request workflow automation to automatically detect and label merge conflicts, with notifications posted to maintainers for resolution before review.

@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown

Walkthrough

A new GitHub Actions workflow is introduced that automatically detects merge conflicts in pull requests. When conflicts are discovered, the workflow labels the PR with "PR has merge conflicts" and posts a comment instructing maintainers to resolve conflicts before proceeding with review.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/label-merge-conflicts.yml
Added a new workflow that triggers on push and pull_request_target events (opened, reopened, synchronize). Uses eps1lon/actions-label-merge-conflict@v3 to detect merge conflicts, automatically labeling PRs with "PR has merge conflicts" and posting a conflict resolution notification comment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

  • #47 — Directly implements GitHub Actions workflow automation for detecting and labeling pull requests with merge conflicts, aligned with this workflow's functionality.
  • #13 — Directly implements automated merge-conflict detection and labeling for PRs with conflict notifications, matching this workflow's objectives.

Poem

🐰 Conflict detection, swift and true,
Labels appear, shiny and new,
GitHub Actions hop with might,
Merge conflicts caught just right!

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add merge conflict labelling workflow' is concise and clearly describes the primary change: adding a GitHub Actions workflow for detecting and labeling merge conflicts.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 3-6: The workflow's unscoped push trigger causes runs on every
branch; narrow the trigger by changing the top-level on: push to only target the
base branch (e.g., replace the bare "push:" with "push: branches: [main]") so
the workflow only runs when main is updated, while keeping the existing
pull_request_target: types: [opened, reopened, synchronize] intact; update the
YAML around the on/push/pull_request_target keys accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 392175c6-59c5-4b37-98f7-ce0854998c40

📥 Commits

Reviewing files that changed from the base of the PR and between 50b05d4 and 659ac26.

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

Comment on lines +3 to +6
on:
push:
pull_request_target:
types: [opened, reopened, synchronize]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider scoping the push trigger to specific branches.

The unfiltered push trigger fires on every push to every branch, which may cause unnecessary workflow runs. Typically, you only need to re-check PRs for conflicts when the base branch (e.g., main) is updated.

♻️ Suggested improvement
 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 3 - 6, The
workflow's unscoped push trigger causes runs on every branch; narrow the trigger
by changing the top-level on: push to only target the base branch (e.g., replace
the bare "push:" with "push: branches: [main]") so the workflow only runs when
main is updated, while keeping the existing pull_request_target: types: [opened,
reopened, synchronize] intact; update the YAML around the
on/push/pull_request_target keys accordingly.

@Zahnentferner Zahnentferner merged commit e54700e into StabilityNexus:main Mar 26, 2026
2 checks passed
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.

2 participants