-
Notifications
You must be signed in to change notification settings - Fork 196
GitHub Action Manage Stale PRs
This GitHub Action helps manage the lifecycle of pull requests by automatically labeling PRs based on age and flagging those that may be suffering from merge debt. It’s part of SSW’s standard pull request workflow.
-
On PR opened or marked “ready for review”, if it's targeting the
mainbranch - Every 2 hours
- Manually, using the "Run workflow" button in GitHub
-
When a new PR is opened or marked ready:
-
Checks if it's not cross-repository
-
Applies the label:
Age: 🥚 - New(i.e. "about 2 hours old")
-
This gives the PR an initial "age" label as a starting point.
Every 2 hours, the workflow will:
-
Ensure labels exist for the following age groups:
-
🥚 New – 2 hours
-
🐣 Young – 4 hours
-
🐥 Adolescent – 8 hours
-
🐤 Mature – 16 hours
-
🐓 Old – 32 hours
-
🍗 Ancient – 64 hours
-
🦖 Extinct – 128+ hours
-
-
Loop through all open PRs
-
Calculates how many hours old each PR is
-
Applies the appropriate age label
-
Removes any other age labels
-
-
Add “Merge Debt” label & comment if needed
-
If a PR is over 36 hours old
-
And the author is not a bot
-
And it doesn’t already have a "🔥 Merge Debt" label
→ Then it:-
Adds the 🔥 Merge Debt label
-
Posts a friendly comment reminding the author to take action:
"This PR has been here a while... Please action (e.g. get a review) and merge or close."
-
-
- How to Create Rules
- How to Edit Rules
- How to Rename Rules
- How to Add and Edit Categories and Top Categories
- How to Rename Categories
- Creating your Fork (One time setup)
- Merging Your Fork
- Updating your fork
- Using Markdown
- Editing MDX Components (in GitHub)