auto pr close #161039
Replies: 4 comments 3 replies
-
|
Hi @prem7443! In GitHub, there is no default behavior or built-in setting that automatically closes a pull request (PR) if it has merge conflicts. Merge conflicts are a common part of collaborative development, and GitHub generally expects developers to resolve them manually before a PR can be merged. A PR with conflicts simply shows a warning indicating that it "can't be merged automatically," but it remains open and awaits resolution. That said, it's possible to automate the closing of pull requests with conflicts using GitHub Actions or other CI/CD workflows. For example, a GitHub Action can be set up to detect when a pull request becomes unmergeable (due to conflicts with the base branch) and then automatically close it. This, however, requires explicit configuration and scripting on your part. GitHub provides APIs and webhook events that allow you to track PR status changes and perform such actions programmatically. It’s important to consider the implications of automatically closing PRs. In most projects, conflicts are resolved through rebase or merge, and closing a PR outright could mean losing valuable contributions unless they are reopened or recreated. For that reason, most teams prefer to notify the developer through comments or CI checks rather than closing the PR. |
Beta Was this translation helpful? Give feedback.
-
|
Hi! 👋 Great question — I think you're asking whether it's possible to automatically close a PR when it has merge conflicts. Here's a breakdown: GitHub doesn’t auto-close PRs with merge conflicts by default. However, you can implement automation with GitHub Actions to close PRs that have merge conflicts. For example, a bot can check for conflicts and auto-close the PR with a comment. Here’s a general idea:
There are some community actions or you could write a custom script using the REST API. But keep in mind: Let me know if you'd like an example GitHub Action for this! Happy to help set it up. 😊 |
Beta Was this translation helpful? Give feedback.
-
|
are u unable to help me |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
is there any method when pr create if code conflict it was auto closed
Beta Was this translation helpful? Give feedback.
All reactions