Skip to content

Commit b586b0c

Browse files
Merge pull request #101 from kpj2006/patch-4
Add workflow to mark stale issues and pull requests
2 parents bcc461b + e2c6f0d commit b586b0c

1 file changed

Lines changed: 153 additions & 0 deletions

File tree

.github/workflows/stale.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: Mark stale issues and pull requests
2+
3+
on:
4+
schedule:
5+
# Runs every hour at minute 35.
6+
# `@maintainer`: For most repos a daily schedule is sufficient, e.g. '0 1 * * *'
7+
- cron: "0 1 * * *"
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
stale:
14+
permissions:
15+
issues: write # required: mark stale, comment, and close issues
16+
pull-requests: write # required: mark stale, comment, and close PRs
17+
# contents: write # @maintainer: uncomment if you enable delete-branch: true
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/stale@v10
22+
with:
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
# ── Stale & close timing ────────────────────────────────────────────
26+
# Issues inactive for 90 days are marked stale
27+
days-before-issue-stale: 90
28+
# PRs inactive for 14 days are marked stale
29+
days-before-pr-stale: 14
30+
# Close stale issues after 7 more days of inactivity
31+
days-before-issue-close: 7
32+
# Close stale PRs after 7 more days of inactivity
33+
days-before-pr-close: 7
34+
35+
# ── Messages ────────────────────────────────────────────────────────
36+
stale-issue-message: >
37+
Hello 👋 This issue has been open for more than 3 months with no activity.
38+
If it is still relevant, please leave a comment to keep it alive — community
39+
support is always welcome! If you found a fix, please open a pull request. 🙏
40+
This issue will be automatically closed in **7 days** if there is no further activity.
41+
42+
stale-pr-message: >
43+
Hello 👋 This PR has had no activity for more than 2 weeks.
44+
If you are still working on it, please push an update or leave a comment.
45+
Ping a maintainer if you believe it is ready for review or merge!
46+
This PR will be automatically closed in **7 days** if there is no further activity.
47+
48+
# Message posted when a stale issue is actually closed
49+
close-issue-message: >
50+
This issue was automatically closed after being stale for 7 days with no activity. 😔
51+
If you believe this was closed in error, feel free to reopen it with additional context.
52+
Thank you for contributing to AOSSIE! 🙏
53+
54+
# Message posted when a stale PR is actually closed
55+
close-pr-message: >
56+
This PR was automatically closed after being stale for 7 days with no activity. 😔
57+
If you would like to continue, please reopen it and ping a maintainer for a review.
58+
Thank you for your contribution to AOSSIE! 🙏
59+
60+
# ── Labels ──────────────────────────────────────────────────────────
61+
stale-issue-label: 'Stale'
62+
stale-pr-label: 'Stale'
63+
# Reason shown on GitHub when an issue is closed automatically
64+
close-issue-reason: 'not_planned'
65+
66+
# @maintainer: Uncomment and set a label to apply when issues are auto-closed
67+
# close-issue-label: 'Closed - Stale'
68+
69+
# @maintainer: Uncomment and set a label to apply when PRs are auto-closed
70+
# close-pr-label: 'Closed - Stale'
71+
72+
# ── Exempt labels ────────────────────────────────────────────────────
73+
# Issues carrying ANY of these labels are never marked stale.
74+
# @maintainer: Adjust the list to match your project's label conventions.
75+
exempt-issue-labels: 'Keep Open,Accepted,In Progress,help wanted,good first issue'
76+
77+
# PRs carrying ANY of these labels are never marked stale.
78+
# @maintainer: Adjust as needed (e.g. add 'ready for review').
79+
exempt-pr-labels: 'Keep Open,Work In Progress,WIP'
80+
81+
# ── Draft PR protection ──────────────────────────────────────────────
82+
# Draft PRs are always excluded — they are explicitly works in progress.
83+
exempt-draft-pr: true
84+
85+
# ── Milestone protection ─────────────────────────────────────────────
86+
# @maintainer: Uncomment to prevent staling issues/PRs that belong to a milestone.
87+
# exempt-all-issue-milestones: true
88+
# exempt-all-pr-milestones: true
89+
90+
# @maintainer: Or exempt only specific milestone names (comma-separated):
91+
# exempt-issue-milestones: 'v1.0,v2.0'
92+
# exempt-pr-milestones: 'v1.0,v2.0'
93+
94+
# ── Assignee protection ──────────────────────────────────────────────
95+
# @maintainer: Uncomment to prevent staling any assigned issue or PR.
96+
# exempt-all-issue-assignees: true
97+
# exempt-all-pr-assignees: true
98+
99+
# @maintainer: Or exempt specific maintainer/bot accounts (comma-separated):
100+
# exempt-issue-assignees: 'maintainer1,maintainer2'
101+
# exempt-pr-assignees: 'maintainer1,maintainer2'
102+
103+
# ── PR filtering ─────────────────────────────────────────────────────
104+
# @maintainer: Uncomment to process ONLY PRs that carry a specific label
105+
# (e.g. only chase PRs that are waiting on the author to respond).
106+
# only-pr-labels: 'Needs Author Reply'
107+
108+
# @maintainer: Uncomment to process only issues/PRs that carry AT LEAST ONE
109+
# of the listed labels (useful to target specific categories).
110+
# any-of-labels: 'needs-more-info,awaiting-feedback'
111+
112+
# ── Branch cleanup ───────────────────────────────────────────────────
113+
# @maintainer: Set to true to auto-delete branches of auto-closed stale PRs.
114+
# Also requires 'contents: write' permission in the job block above.
115+
# delete-branch: false
116+
117+
# ── Behaviour ────────────────────────────────────────────────────────
118+
# Remove the Stale label automatically when a new comment or push arrives.
119+
remove-stale-when-updated: true
120+
121+
# Process oldest issues/PRs first so long-standing contributions get attention.
122+
ascending: true
123+
124+
# Cap GitHub API calls per run to stay within rate limits.
125+
# @maintainer: Raise this (e.g. 100–200) if your repo has many open items.
126+
operations-per-run: 30
127+
128+
# Print a statistics summary at the end of each run (useful for debugging).
129+
enable-statistics: true
130+
131+
# ── Label transitions ─────────────────────────────────────────────────
132+
# @maintainer: Uncomment to strip a label when an issue/PR becomes stale.
133+
# labels-to-remove-when-stale: 'In Progress'
134+
135+
# @maintainer: Uncomment to add a label when an issue/PR becomes un-stale.
136+
# labels-to-add-when-unstale: 'In Progress'
137+
138+
# @maintainer: Uncomment to strip a label when an issue/PR becomes un-stale.
139+
# labels-to-remove-when-unstale: 'Needs Author Reply'
140+
141+
# ── Start date ────────────────────────────────────────────────────────
142+
# @maintainer: Uncomment and set a date to skip issues/PRs created before it.
143+
# Handy when adding this workflow to an existing repo with old open items.
144+
# start-date: '2024-01-01T00:00:00Z' # ISO 8601 format
145+
146+
# ── Issue types ───────────────────────────────────────────────────────
147+
# @maintainer: Uncomment to restrict stale processing to specific issue types
148+
# (GitHub Issues feature — only applies if your org uses issue types).
149+
# only-issue-types: 'bug,feature'
150+
151+
# ── Sort order ────────────────────────────────────────────────────────
152+
# @maintainer: Change sort field if needed. Options: created | updated | comments
153+
# sort-by: 'created'

0 commit comments

Comments
 (0)