Skip to content

Commit 58225d2

Browse files
committed
Workflows: Label stale issues and PRs
1 parent a9713fa commit 58225d2

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# GitHub Action reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2+
3+
name: issue-comment-created
4+
5+
on:
6+
issue_comment:
7+
types: [created]
8+
9+
permissions:
10+
issues: write
11+
12+
jobs:
13+
remove-labels:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions-ecosystem/action-remove-labels@v1
17+
with:
18+
labels: |
19+
stale
20+
waiting-response
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# GitHub Action reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2+
3+
name: issue-or-pr-closed
4+
5+
on:
6+
issues:
7+
types: [closed]
8+
pull_request_target:
9+
types: [closed]
10+
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
15+
jobs:
16+
remove-labels:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
labels: ['needs-triage', 'waiting-response']
21+
steps:
22+
- name: Remove ${{ matrix.labels }} label
23+
uses: actions-ecosystem/action-remove-labels@v1
24+
if: contains(github.event.*.labels.*.name, matrix.labels)
25+
with:
26+
labels: ${{ matrix.labels }}

.github/workflows/stale.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# GitHub Action reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2+
#
3+
# Automated handling of stale issues and pull requests.
4+
#
5+
# NOTE: When changing "days-before-*" values, please also update the "stale-issue-message" and/or
6+
# "stale-pr-message" values.
7+
8+
name: stale
9+
10+
on:
11+
schedule:
12+
# ┌───────────── minute (0 - 59)
13+
# │ ┌───────────── hour (0 - 23)
14+
# │ │ ┌───────────── day of the month (1 - 31)
15+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
16+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
17+
# * * * * *
18+
- cron: '8 3 * * *'
19+
20+
permissions:
21+
issues: write
22+
pull-requests: write
23+
24+
jobs:
25+
stale:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/stale@v4
29+
with:
30+
stale-issue-label: 'stale'
31+
stale-pr-label: 'stale'
32+
stale-issue-message: |
33+
Marking this issue as stale due to 90 days of inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 14 days it will automatically be closed. Maintainers can also remove the `stale` label.
34+
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
35+
stale-pr-message: |
36+
Marking this pull request as stale due to 30 days of inactivity. This helps our maintainers find and focus on the active pull requests. If this pull request receives no comments in the next 14 days it will automatically be closed. Maintainers can also remove the `stale` label.
37+
If this pull request was automatically closed and you feel this pull request should be reopened, we encourage creating a new pull request linking back to this one for added context. Thank you!
38+
close-issue-message: 'This issue was closed because it has been stale for 14 days with no activity.'
39+
close-pr-message: 'This PR was closed because it has been stale for 14 days with no activity.'
40+
days-before-issue-stale: 90
41+
days-before-pr-stale: 30
42+
days-before-issue-close: 14
43+
days-before-pr-close: 14
44+
exempt-issue-labels: keep-open,bug,enhancement

0 commit comments

Comments
 (0)