Skip to content

Add Draft PR Cleanup workflow#146

Closed
github-actions[bot] wants to merge 1 commit intomainfrom
add-draft-pr-cleanup-8cebe9bef2e8b5fb
Closed

Add Draft PR Cleanup workflow#146
github-actions[bot] wants to merge 1 commit intomainfrom
add-draft-pr-cleanup-8cebe9bef2e8b5fb

Conversation

@github-actions
Copy link
Contributor

Summary

Adds a new Draft PR Cleanup workflow to automatically manage stale draft pull requests, keeping the PR list clean and maintainable.

Source

Origin: gh-aw/draft-pr-cleanup.md

This workflow was created in the gh-aw repository after the Agent Performance Analyzer identified that draft PRs accounted for 9.6% of open PRs, causing triage overhead.

Why This Workflow?

High Value

  • Simple and focused: One clear task with well-defined policy
  • General applicability: Works for ANY repository with pull requests
  • Zero dependencies: No language-specific tools or frameworks required
  • Practical impact: Reduces clutter and improves maintainer efficiency

Proven Success

The workflow has demonstrated success in the gh-aw repository by:

  • Reducing draft PR rate from 9.6% to manageable levels
  • Improving triage efficiency for maintainers
  • Providing clear, respectful communication to contributors

How It Works

Two-Phase Policy

Warning Phase (10-13 days inactive)

  • Adds friendly warning comment
  • Applies stale-draft label
  • Explains how to prevent closure

Cleanup Phase (14+ days inactive)

  • Closes PR with respectful message
  • Emphasizes this is not a rejection
  • Explains how to reopen if needed

Exemptions

PRs with these labels are never auto-closed:

  • keep-draft - Explicitly keep open
  • blocked - Waiting on dependencies
  • awaiting-review - Ready but still in draft

Inactivity Definition

No commits, comments, label changes, or PR updates

Generalization Changes

From the gh-aw original:

  • ✅ Removed gh-aw-specific references
  • ✅ Made all messages repository-agnostic
  • ✅ Simplified to use standard GitHub tools only
  • ✅ Removed internal imports (shared/mood.md)
  • ✅ Kept the core two-phase policy (10 days warning, 14 days closure)
  • ✅ Maintained respectful, clear communication style

Files Added

  • workflows/draft-pr-cleanup.md - Workflow definition
  • docs/draft-pr-cleanup.md - Comprehensive documentation
  • README.md - Added to Triage Workflows section

Benefits for Any Repository

  1. Cleaner PR list: Easier to see active work
  2. Better triage: Reduces noise for maintainers
  3. Automatic tracking: No manual intervention
  4. Fair warning: Always notifies before closing
  5. Reversible: Closed PRs can be reopened anytime

Documentation Highlights

The docs include:

  • Clear policy explanation
  • Prevention strategies for contributors
  • Example warning and closure messages
  • Configuration options
  • Best practices for maintainers and contributors
  • Success metrics and monitoring

Testing Recommendations

After merging:

  1. Enable the workflow with gh aw compile
  2. Monitor first few runs to ensure proper behavior
  3. Adjust thresholds if needed based on repository velocity
  4. Communicate policy in CONTRIBUTING.md

Related Workflows


Phase 1 Check: ✅ Repository consistency verified - all workflows have docs, all docs are in README.

Phase 2 Evaluation: Selected Draft PR Cleanup as the best candidate based on:

  • Simplicity and clear focus
  • General applicability (works for any repo)
  • Zero language/tool dependencies
  • Proven practical value
  • Easy to understand and maintain

AI generated by Daily Repo Goal Achiever

- Adds automated stale draft PR management workflow
- Warns after 10 days of inactivity, closes after 14 days
- Respects exemption labels (keep-draft, blocked, awaiting-review)
- Includes comprehensive documentation with examples
- General-purpose workflow applicable to any repository
@github-actions github-actions bot added automation documentation Improvements or additions to documentation factory hygiene labels Feb 13, 2026
@dsyme dsyme closed this Feb 16, 2026
@pelikhan pelikhan deleted the add-draft-pr-cleanup-8cebe9bef2e8b5fb branch February 17, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation documentation Improvements or additions to documentation factory hygiene

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant