Skip to content

Automates the detection, labeling, and resolution of pull request conflicts, ensuring a smoother and more efficient CI/CD workflow.

License

Notifications You must be signed in to change notification settings

MrKacmaz/pull-request-conflict-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”€ GitHub Pull Request Conflict Manager

This repository provides two GitHub Actions workflows to automatically manage the conflict label on pull requests (PRs) based on their mergeable status. These workflows help your team identify and resolve merge conflicts more efficiently.

πŸ“¦ Included Workflows

1. conflict-adder.yml

Automatically adds a conflict label and a comment to any open PRs that become conflicted after another PR is merged into the base branch (typically master or develop).

πŸ”§ Triggered When:

  • A pull request is closed and merged into the target branch.

🧠 What It Does:

  • Iterates through all open PRs targeting the same base branch.
  • Checks if any of them now have merge conflicts.
  • If so, adds a conflict label and posts a comment like:

    "This pull request now has merge conflicts, likely due to the recent merge of #123 into master."


2. conflict-remover.yml

Automatically removes the conflict label and posts a follow-up comment when the conflict is resolved (typically after new commits are pushed to the PR branch).

πŸ”§ Triggered When:

  • A pull request is edited or synchronized (i.e., new commits are pushed).

🧠 What It Does:

  • Checks if the PR is now mergeable (i.e., no longer has conflicts).
  • If so:
    • Removes the conflict label.
    • Posts a comment like:

      "Merge conflicts have been resolved. Thank you!"

πŸ–ΌοΈ Visual Example

Here’s how a PR looks when a conflict is detected and labeled automatically:

Conflict Label Applied


🏷️ Requirements

  • These workflows expect a label named conflict to exist in your repository. Create it manually via the GitHub UI if it doesn't exist.
  • Make sure your base branch (e.g., master, develop) is correctly set in each workflow file under the branches key.

βœ… Benefits

  • Saves time by automatically tracking PRs that require attention due to merge conflicts.
  • Keeps your PR list clean and well-labeled.
  • Improves collaboration by notifying authors directly with friendly comments.

πŸ“œ License

This project is released under the MIT License.


πŸ™Œ Contributing

Feel free to open an issue or PR if you'd like to improve or extend these workflows!

About

Automates the detection, labeling, and resolution of pull request conflicts, ensuring a smoother and more efficient CI/CD workflow.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published