GitHub Actions Stale Issues/PRs Workflow Builder

Auto-label and close stale issues and pull requests

Generate a GitHub Actions stale.yml using actions/stale@v9 with configurable days-before-stale, days-before-close, exempt labels, and custom stale and close messages. Runs entirely in your browser.

What does days-before-close count from?

It counts from the moment the item is marked stale, not from the last activity. So a 60-day stale plus 7-day close means an item can sit untouched for 67 days before it is automatically closed.

A GitHub Actions stale workflow builder that generates a ready-to-commit stale.yml using the official actions/stale@v9 action. It marks inactive issues and pull requests as stale, then closes them after a grace period — unless they carry a label you have marked as exempt. The result is a self-maintaining issue tracker that does not drown in abandoned tickets.

How it works

The generated workflow runs on a schedule (a cron expression in UTC) and can also be triggered manually via workflow_dispatch. On each run, actions/stale scans open issues and PRs and compares each item’s last-activity time against days-before-stale. Items past that threshold get the stale label and a comment. A second timer, days-before-close, counts forward from when the item became stale; once it elapses, the item is closed with a closing comment.

Exempt labels short-circuit the whole process: an item with pinned, security, or any label you list is never touched. The job declares issues: write and pull-requests: write permissions so it can apply labels, comment, and close — operations a read-only token cannot perform.

Tips and notes

  • Keep operations-per-run modest on large repositories. The action burns API quota for every comment and label change, and a huge backlog can otherwise exhaust your hourly limit.
  • Set days-before-close to -1 if you only want a stale label and a nudge, leaving the close decision to a human.
  • Run the workflow on workflow_dispatch first to preview behavior before trusting the schedule — the action logs exactly which items it would mark or close.
  • Schedule it during off-peak UTC hours (for example 0 1 * * *) so the notification burst does not land in the middle of your team’s workday.