Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore(ci): add PR autocloser#640

Merged
jdx merged 1 commit into
mainfrom
chore/add-pr-closer
May 17, 2026
Merged

chore(ci): add PR autocloser#640
jdx merged 1 commit into
mainfrom
chore/add-pr-closer

Conversation

@jdx

@jdx jdx commented May 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a scheduled PR autocloser workflow
  • close inactive PRs after 7 days only when they have failing checks or merge conflicts
  • keep 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
Automatically closing PRs can disrupt contributor workflows if the query/filters are too broad or GitHub status/merge-state signals are misinterpreted. The change is limited to CI automation and uses scoped permissions, but it performs write actions on PRs.

Overview
Adds a new scheduled and manually-triggerable GitHub Actions workflow (pr-closer) that scans open PRs inactive for 7+ days (excluding drafts, keep-open labeled PRs, and PRs by jdx).

The job uses gh pr list + jq to auto-close PRs only when they have failing checks and/or merge conflicts, while only logging and skipping cases with cancelled checks or unknown merge state.

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

@gemini-code-assist

Copy link
Copy Markdown
Contributor

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
Contributor

Greptile Summary

Adds a new pr-closer GitHub Actions workflow that runs daily (and on demand) to close open PRs inactive for 7+ days when they have failing CI checks or merge conflicts, while skipping drafts, keep-open-labelled PRs, and jdx-authored PRs.

  • Both CheckRun (.conclusion) and legacy commit-status (StatusContext.state) objects are handled via the // .state // fallback, and the concurrency group prevents duplicate runs from racing.
  • PRs with UNKNOWN merge state or only cancelled checks are logged and skipped rather than closed, keeping automated closure conservative.

Confidence Score: 5/5

Safe to merge — the workflow only affects repository automation and is conservative by design (unknown/cancelled states are skipped, not closed).

The workflow correctly handles both GitHub Actions check runs and legacy commit statuses, guards against concurrent executions with the cancellation group, and has no code paths that could cause unintended data loss or destructive side effects in the main codebase. The only finding is a minor date-offset discrepancy that makes the actual threshold slightly longer than advertised.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/pr-closer.yml New scheduled workflow that auto-closes stale PRs with failing checks or merge conflicts; logic is sound, concurrency group present, StatusContext fallback handled. Minor date-offset discrepancy between stated and actual 7-day threshold.

Fix All in Claude Code

Reviews (3): Last reviewed commit: "chore(ci): add PR autocloser" | Re-trigger Greptile

Comment thread .github/workflows/pr-closer.yml Outdated
Comment thread .github/workflows/pr-closer.yml
@codecov

codecov Bot commented May 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.25%. Comparing base (fe754a4) to head (0e542f0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #640   +/-   ##
=======================================
  Coverage   73.25%   73.25%           
=======================================
  Files          49       49           
  Lines        7455     7455           
  Branches     7455     7455           
=======================================
  Hits         5461     5461           
  Misses       1359     1359           
  Partials      635      635           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jdx jdx force-pushed the chore/add-pr-closer branch from 3f38663 to 388fda5 Compare May 17, 2026 15:54
@jdx jdx force-pushed the chore/add-pr-closer branch from 388fda5 to 0e542f0 Compare May 17, 2026 16:06
@jdx jdx merged commit db1d1c2 into main May 17, 2026
8 checks passed
@jdx jdx deleted the chore/add-pr-closer branch May 17, 2026 16:12
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