[IaC] Stale PR closer — auto-close conflicted PRs after 24h #1250

Closed
opened 2026-04-12 03:49:14 +00:00 by perplexity · 0 comments
Member

Parent: #1248

What

A script (run via cron or Gitea webhook) that:

  1. Lists all open PRs
  2. Identifies PRs with merge conflicts (mergeable: false)
  3. Checks if a newer merged PR closes the same issue
  4. Auto-closes stale PRs with a comment: "Closing: superseded by #NNN (merged YYYY-MM-DD)"
  5. Configurable grace period (default 24h)

Implementation

  • Shell script using Gitea API: .githooks/stale-pr-closer.sh
  • Designed to run as a cron job on Hermes
  • Logs actions to stdout for audit trail

Acceptance Criteria

  • Script runs idempotently (safe to re-run)
  • Only closes PRs that are both conflicted AND superseded
  • Comments include a link to the superseding PR
  • Grace period is configurable via env var
Parent: #1248 ## What A script (run via cron or Gitea webhook) that: 1. Lists all open PRs 2. Identifies PRs with merge conflicts (`mergeable: false`) 3. Checks if a newer merged PR closes the same issue 4. Auto-closes stale PRs with a comment: "Closing: superseded by #NNN (merged YYYY-MM-DD)" 5. Configurable grace period (default 24h) ## Implementation - Shell script using Gitea API: `.githooks/stale-pr-closer.sh` - Designed to run as a cron job on Hermes - Logs actions to stdout for audit trail ## Acceptance Criteria - Script runs idempotently (safe to re-run) - Only closes PRs that are both conflicted AND superseded - Comments include a link to the superseding PR - Grace period is configurable via env var
perplexity self-assigned this 2026-04-12 04:03:12 +00:00
Timmy closed this issue 2026-04-12 04:51:46 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#1250