Skip to content

Commit c5aff2a

Browse files
authored
Add a workflow to automatically close stale PRs and comment / tag stale issues (exercism#2023)
* Add an action/stale label for the workflow to use * Setup a basic stale action
1 parent 04744dc commit c5aff2a

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

.appends/.github/labels.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
# https://github.com/exercism/org-wide-files/blob/main/global-files/.github/labels.yml. #
44
# ----------------------------------------------------------------------------------------- #
55

6+
- name: "action/stale"
7+
description: "Applied (and removed) automatically by the stale workflow to indicate an issue or pull request is stale"
8+
color: "d93f0b"
9+
610
- name: "announcement"
711
description: ""
812
color: "d461d8"

.github/workflows/stale.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow warns for stale issues and PRs that have had no activity for a specified amount of time.
2+
#
3+
# You can adjust the behavior by modifying this file.
4+
# For more information, see:
5+
# https://github.com/actions/stale
6+
name: Mark stale issues and pull requests
7+
8+
on:
9+
schedule:
10+
- cron: '41 3 * * *'
11+
12+
jobs:
13+
stale:
14+
15+
runs-on: ubuntu-latest
16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
20+
steps:
21+
- uses: actions/stale@v4
22+
with:
23+
repo-token: ${{ secrets.GITHUB_TOKEN }}
24+
# Mark issues as stale once per quarter, but never close.
25+
days-before-issue-stale: 90
26+
days-before-issue-close: -1
27+
# Mark PRs as stale every month, close if not updated in a week.
28+
days-before-pr-stale: 30
29+
days-before-pr-close: 7
30+
31+
# Milestones on an issue or a PR exempted from being marked as stale.
32+
exempt-milestones: true
33+
# Exempt all issues with milestones from being marked as stale.
34+
exempt-all-issue-milestones: true
35+
36+
stale-issue-label: 'action/stale'
37+
stale-issue-message: >
38+
This issue has been automatically marked as `action/stale`
39+
because it has not had recent activity. Please update if there are
40+
new updates to provide.
41+
42+
stale-pr-label: 'action/stale'
43+
stale-pr-message: >
44+
This pull request has been automatically marked as `stale`
45+
because it has not had recent activity. It will be closed if no
46+
further activity occurs. Thank you for your contributions.
47+
close-pr-message: >
48+
Closing stale pull request. If you are still working on this,
49+
please reopen this pull request.

0 commit comments

Comments
 (0)