Skip to content

feat: auto-close inactive merge-conflicted PRs#1289

Open
VanshajPoonia wants to merge 1 commit into
AOSSIE-Org:mainfrom
VanshajPoonia:feat/stale-merge-conflicted-prs
Open

feat: auto-close inactive merge-conflicted PRs#1289
VanshajPoonia wants to merge 1 commit into
AOSSIE-Org:mainfrom
VanshajPoonia:feat/stale-merge-conflicted-prs

Conversation

@VanshajPoonia
Copy link
Copy Markdown
Contributor

@VanshajPoonia VanshajPoonia commented May 25, 2026

Addressed Issues:

Fixes #1279

Screenshots/Recordings:

N/A — this PR only adds a GitHub Actions workflow and does not include UI changes.

Additional Notes:

This PR adds a separate scheduled workflow for stale merge-conflicted PR cleanup. The existing merge conflict labeling workflow is left unchanged.

The new workflow only targets PRs with the PR has merge conflicts label, warns them after 30 days of inactivity, and closes them after 5 additional inactive days if there is still no activity.

AI Usage Disclosure:

  • 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: ChatGPT and Codex

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
    • Added automated workflow to manage pull requests with unresolved merge conflicts. Inactive PRs will receive a warning notification after 30 days without activity and will be automatically closed after an additional 5 days, with guidance provided to help contributors resolve conflicts.

Review Change Stack

@github-actions github-actions Bot added CI/CD enhancement New feature or request labels May 25, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Walkthrough

A new GitHub Actions workflow detects pull requests with merge conflicts and automatically manages their lifecycle based on inactivity. After 30 inactive days, contributors receive a warning; after 5 more inactive days without updates, the PR is automatically closed. Custom labels and messaging preserve the merge-conflict label meaning while guiding contributors to resolve conflicts or restart the stale timer.

Changes

Stale merge-conflict PR auto-closure

Layer / File(s) Summary
Stale PR detection and auto-closure configuration
.github/workflows/stale-merge-conflicts.yml
GitHub Actions workflow scheduled daily and manual-dispatch-triggered. Uses actions/stale@v10 to target PRs labeled PR has merge conflicts. Warns after 30 inactive days with custom message requesting conflict resolution. Auto-closes after 5 additional inactive days. Preserves merge-conflict label semantics by using distinct stale/close label names. Removes stale markers on PR update.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A workflow so fine, with patience so keen,
Waits thirty days quiet, then speaks up serene,
"Resolve your conflicts, or rest you shall go"—
Five days more waiting, then closed with a bow. 🐰✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding automatic closure of inactive merge-conflicted PRs, which matches the core purpose of the changeset.
Linked Issues check ✅ Passed The implementation meets all coding requirements from issue #1279: targets PRs with merge conflicts label, posts warning after 30 days inactivity, closes after additional 5 days, and provides clear warning messages.
Out of Scope Changes check ✅ Passed All changes are within scope—the PR adds only the new GitHub Actions workflow file without modifying the existing merge-conflict labeling workflow or other unrelated code.

✏️ 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.

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/stale-merge-conflicts.yml:
- Line 19: The workflow currently references the mutable tag "actions/stale@v10"
which must be pinned to a full 40-character commit SHA; update the uses entry
for the stale action (the line containing "uses: actions/stale@v10") to use the
corresponding full commit SHA (e.g., "actions/stale@<40-hex-sha>") so the action
is pinned to an exact commit, then commit the change to the workflow file.
🪄 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.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1e461acd-3a0a-40dd-b9d4-82af4c9686a0

📥 Commits

Reviewing files that changed from the base of the PR and between 0528751 and 1a69dd2.

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

Comment thread .github/workflows/stale-merge-conflicts.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant