Skip to content

Feat: Enhance merge conflict workflow to auto-close stale PRs #1279

@rohan-pandeyy

Description

@rohan-pandeyy

Describe the feature

Currently, the repository has a workflow that automatically detects pull requests with merge conflicts, applies the PR has merge conflicts label, and comments on the PR asking contributors to resolve the conflicts before review.

This workflow helped significantly during periods of high contribution activity (such as GSoC and other community events), where a large number of PRs were opened simultaneously.

However, many of these PRs are now inactive. Some contributors are no longer active, leaving merge-conflicted PRs open indefinitely. These PRs cannot be reviewed or merged in their current state, and manually managing them has become difficult due to the backlog size.

The goal of this issue is to improve the existing merge conflict workflow by introducing a stale/cleanup mechanism.


Expected behavior

If a PR has merge conflicts and remains inactive for a long period:

  1. The workflow should detect inactivity after a configurable duration (for example, 30 days).

  2. The workflow should post another reminder comment informing the contributor that:

    • the PR still has merge conflicts,
    • there has been no recent activity,
    • and the PR may be automatically closed if no action is taken.
  3. If there is still no activity for an additional grace period (for example, 5 more days), the workflow should automatically close the PR.


Possible implementation ideas

  • Extend the existing .github/workflows/label-merge-conflicts.yml workflow.

  • Use:

    • actions/stale,
    • GitHub Script,
    • or a custom scheduled workflow.
  • Ensure that:

    • only PRs with merge conflicts are targeted,
    • active PRs are not accidentally closed,
    • and contributors receive clear warning messages before closure.

Existing workflow

Current workflow file:

.github/workflows/label-merge-conflicts.yml

Current behavior:

  • Detects merge conflicts
  • Applies label: PR has merge conflicts
  • Comments on the PR with guidance for resolving conflicts

Additional context

This issue is mainly focused on reducing long-term maintenance overhead from inactive merge-conflicted PRs while still giving contributors enough time and visibility to resolve conflicts before automatic closure.

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions