Skip to content

Commit 610df3a

Browse files
authored
Merge pull request #824 from armsnyder/workflow-stale
Workflows: Label stale issues and PRs, and issue triage labels
2 parents e162385 + 3e6d811 commit 610df3a

File tree

5 files changed

+132
-0
lines changed

5 files changed

+132
-0
lines changed

.github/labeler-issue-triage.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Issue Labeler documentation: https://github.com/marketplace/actions/regex-issue-labeler
2+
3+
bug:
4+
# General:
5+
# panic:
6+
# Terraform CLI:
7+
# Provider produced inconsistent final plan
8+
# Provider produced inconsistent result after apply
9+
# produced an invalid new value
10+
# produced an unexpected new value
11+
# Terraform Plugin SDK:
12+
# doesn't support update
13+
# Invalid address to set
14+
- "(panic:|Provider produced inconsistent (final plan|result after apply)|produced an (invalid|unexpected) new value|doesn't support update|Invalid address to set)"
15+
16+
needs-triage:
17+
- '.*'
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

.github/workflows/issue-opened.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# GitHub Action reference: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2+
3+
name: issue-opened
4+
5+
on:
6+
issues:
7+
types: [opened]
8+
9+
permissions:
10+
issues: write
11+
12+
jobs:
13+
add-labels:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: github/[email protected]
18+
with:
19+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
20+
configuration-path: .github/labeler-issue-triage.yml
21+
enable-versioned-regex: 0
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
label:
21+
- 'needs-triage'
22+
- 'waiting-response'
23+
- 'needs-rebase'
24+
- 'merge-conflict'
25+
steps:
26+
- name: Remove ${{ matrix.label }} label
27+
uses: actions-ecosystem/action-remove-labels@v1
28+
if: contains(github.event.*.labels.*.name, matrix.label)
29+
with:
30+
labels: ${{ matrix.label }}

.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)