Skip to content

Commit 7751365

Browse files
committed
fix: Added readme for stale-pr
1 parent af03010 commit 7751365

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

docs/stale-pr.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## [Stale Issues and PRs Workflow](https://github.com/clouddrove/github-shared-workflows/blob/master/.github/workflows/stale_pr.yml)
2+
3+
This workflow automatically marks and closes stale issues and pull requests after periods of inactivity. `.github/workflows/stale_pr.yml`
4+
5+
### Overview
6+
Automatically:
7+
- Marks issues as stale after 30 days of inactivity
8+
- Marks PRs as stale after 30 days of inactivity
9+
- Closes stale issues after 10 more days
10+
- Closes stale PRs after 10 more days
11+
- Deletes branches of closed PRs
12+
- Exempts items with specific labels or milestones
13+
14+
### Features
15+
- Configurable time periods for staleness and closure
16+
- Customizable stale and close messages
17+
- Exclusion for items with specific labels (`bug`, `wip`, `on-hold`, `no-stale`)
18+
- Exclusion for all items with milestones
19+
- Automatic branch cleanup for closed PRs
20+
21+
### Usage
22+
This workflow is designed to be called from other workflows using GitHub's `workflow_call` trigger.
23+
24+
#### Example Implementation
25+
```yaml
26+
name: 'Mark or close stale issues and PRs'
27+
28+
on:
29+
schedule:
30+
- cron: '0 0 * * 5' # Runs every Friday midnight
31+
workflow_dispatch:
32+
push:
33+
branches:
34+
- 'main'
35+
36+
jobs:
37+
stale-pr:
38+
uses: clouddrove/github-shared-workflows/.github/workflows/stale_pr.yml@master
39+
with:
40+
days-before-issue-stale: 30 # Days until issue marked stale
41+
days-before-pr-stale: 30 # Days until PR marked stale
42+
days-before-issue-close: 10 # Days after stale until issue closed
43+
days-before-pr-close: 10 # Days after stale until PR closed

0 commit comments

Comments
 (0)