Skip to content

Stale Management

Automatically identify, warn, and close stale issues and pull requests.

Lifecycle

mermaid
stateDiagram-v2
    [*] --> Active: Issue/PR created
    Active --> Stale: No activity for N days
    Stale --> Warned: Bot posts warning
    Warned --> Closed: No activity for M days
    Warned --> Active: New comment/commit
    Stale --> Active: New comment

Idempotency

The stale scanner uses idempotency keys to prevent duplicate actions:

  • Warning: stale-warn-{repo_id}-{type}-{number}
  • Closing: stale-close-{repo_id}-{type}-{number}

If an action with the same key already exists in maintainer_actions, it is skipped.

Bot Filter

Items created by accounts whose login contains [bot] are always skipped.

Label Exemptions

Issues with these labels are never marked stale:

LabelReason
pinnedExplicitly kept open
keep-aliveMaintainer opt-out

Trigger

bash
# Manual trigger for a repo
curl -X POST https://gitwire.yourdomain.com/api/maintainer/owner/repo/stale-scan \
  -H "Authorization: Bearer YOUR_API_KEY"

The stale scanner also runs on the configured schedule via the Maintainer Worker.

Actions Log

All stale actions are recorded in maintainer_actions:

ColumnValues
action_typestale_warn, stale_close
target_typeissue, pr
target_numberIssue/PR number
idempotency_keyUnique key per action
statuspending, applied, skipped, failed

Branch Cleanup

Released under the MIT License.