Skip to content

chore(ci): close failing or conflicted PRs sooner#480

Merged
jdx merged 5 commits into
mainfrom
chore/pr-closer-failing-conflicts
May 17, 2026
Merged

chore(ci): close failing or conflicted PRs sooner#480
jdx merged 5 commits into
mainfrom
chore/pr-closer-failing-conflicts

Conversation

@jdx

@jdx jdx commented May 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • close inactive PRs after 7 days only when they have failing checks or merge conflicts
  • include merge state in the PR closer query and close with the specific reason
  • keep existing exclusions for @jdx-authored and keep-open PRs

Validation

  • actionlint .github/workflows/pr-closer.yml
  • git diff --check
  • jq filter sample validation

Note

Medium Risk
Automates PR closure based on CI/merge-state signals; a bug in the query or jq logic could incorrectly close active or recoverable PRs. Limited to GitHub Actions workflow changes but impacts contributor workflow.

Overview
Updates the pr-closer GitHub Actions workflow to close PRs much sooner (7 days inactivity), but only when they have failing checks and/or merge conflicts.

The workflow now queries mergeStateStatus and expanded check conclusions to generate a specific closure reason, skips “warn-only” states (e.g., cancelled checks/unknown merge state), increases the listing limit to 500, and adds concurrency plus additional read permissions (checks, statuses) to support the new filtering.

Reviewed by Cursor Bugbot for commit 34aded2. Bugbot is set up for automated code reviews on this repo. Configure here.

@gemini-code-assist

Copy link
Copy Markdown

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@greptile-apps

greptile-apps Bot commented May 17, 2026

Copy link
Copy Markdown

Greptile Summary

This PR tightens the pr-closer GitHub Actions workflow to close stale PRs after roughly 7 days of inactivity (down from 30 days), but only when they carry failing checks or merge conflicts rather than closing all inactive PRs indiscriminately.

  • Targeted closure logic: a jq filter now evaluates mergeStateStatus and statusCheckRollup, producing one of three close reasons (failing checks, merge conflicts, or both) and silently skipping PRs whose state is cancelled or unknown.
  • Safer query and runtime: the --search flag consolidates author/label/draft exclusions into a single GitHub search expression; set -o pipefail surfaces upstream failures; || echo \"Warning: …\" prevents a single failing gh pr close from aborting the rest; workflow-level concurrency prevents overlapping runs.

Confidence Score: 5/5

Safe to merge — the change is confined to a scheduled GitHub Actions workflow with no runtime code, and the logic correctly guards against closing PRs in ambiguous states.

The jq filter correctly handles all relevant mergeStateStatus and statusCheckRollup values, skipping UNKNOWN/CANCELLED states conservatively. The shell pipeline is guarded with pipefail and per-iteration error tolerance. No unintentional closure paths were identified.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/pr-closer.yml Rewrites the stale-PR closer to target PRs inactive for ~7 days only when they have failing checks or merge conflicts; adds concurrency control, narrowed search filters, per-reason close messages, and basic error tolerance.

Reviews (6): Last reviewed commit: "Revert "ci: allow reading attestations"" | Re-trigger Greptile

Comment thread .github/workflows/pr-closer.yml Outdated
Comment thread .github/workflows/pr-closer.yml Outdated
Comment thread .github/workflows/pr-closer.yml Outdated
@jdx jdx force-pushed the chore/pr-closer-failing-conflicts branch from 9b9896a to 1ac8ab4 Compare May 17, 2026 15:54

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1ac8ab4. Configure here.

Comment thread .github/workflows/pr-closer.yml
@jdx jdx force-pushed the chore/pr-closer-failing-conflicts branch from 1ac8ab4 to 36d387e Compare May 17, 2026 16:06
@jdx jdx force-pushed the chore/pr-closer-failing-conflicts branch from 36d387e to dbf8712 Compare May 17, 2026 16:17
@jdx jdx merged commit 5b3e4e0 into main May 17, 2026
14 of 19 checks passed
@jdx jdx deleted the chore/pr-closer-failing-conflicts branch May 17, 2026 16:59
@jdx jdx mentioned this pull request May 22, 2026
@jdx jdx mentioned this pull request Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant