Skip to content

Commit 49ac938

Browse files
committed
Enforce issue templates on GitHub
1 parent 078a822 commit 49ac938

2 files changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Close issue based on label
2+
on:
3+
issues:
4+
types:
5+
- labeled
6+
jobs:
7+
close-unsuported-version:
8+
if: github.event.label.name == 'unsupported-version'
9+
name: Autoclose issues with unsupported versions
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
steps:
14+
- name: Autoclose issues with unsupported versions
15+
uses: peter-evans/close-issue@v3
16+
with:
17+
comment: "@${{ github.event.issue.user.login }} this issue was automatically closed because you are using an unsupported version"
18+
close-template-ignored:
19+
if: github.event.label.name == 'template-ignored'
20+
name: Autoclose issues ignoring the template
21+
runs-on: ubuntu-latest
22+
permissions:
23+
issues: write
24+
steps:
25+
- name: Autoclose issues ignoring the template
26+
uses: peter-evans/close-issue@v3
27+
with:
28+
comment: "@${{ github.event.issue.user.login }} this issue was automatically closed because you did not follow the issue template."
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Enforce issue template
2+
on:
3+
issues:
4+
types: [opened, edited, renamed]
5+
6+
jobs:
7+
auto_close_issues:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Autoclose issues that did not follow issue template
11+
if: startsWith(github.event.issue.title, '[BUG]:')
12+
uses: roots/issue-closer@v1.2
13+
with:
14+
repo-token: ${{ secrets.GITHUB_TOKEN }}
15+
issue-close-message: "@${issue.user.login} this issue was automatically closed because it did not follow the issue template"
16+
issue-pattern: ".*### Description.*"
17+
- name: Autoclose issues that are using an old version
18+
if: startsWith(github.event.issue.title, '[BUG]:')
19+
uses: roots/issue-closer@v1.2
20+
with:
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
issue-close-message: "@${issue.user.login} this issue was automatically closed because you are using an unsupported version"
23+
issue-pattern: ".*### Tvheadend Version[\\r\\n]+v4\\.(3 \\(development\\)|4 \\(stable\\)).*"
24+
- name: Autoclose feature ideas which are not developed by the user
25+
if: startsWith(github.event.issue.title, '[FEATURE]:')
26+
uses: roots/issue-closer@v1.2
27+
with:
28+
repo-token: ${{ secrets.GITHUB_TOKEN }}
29+
issue-close-message: "@${issue.user.login} this issue was automatically closed because you are not willing to develop this"
30+
issue-pattern: ".*### Acceptance[\\r\\n]+- \\[X\\] The proposal will be developed and maintained by me.*"
31+
- name: Autoclose issues not having an accepted prefix
32+
if: "!startsWith(github.event.issue.title, '[BUG]:') && !startsWith(github.event.issue.title, '[FEATURE]:')"
33+
uses: peter-evans/close-issue@v3
34+
with:
35+
comment: "@${{ github.event.issue.user.login }} this issue was automatically closed because it did not follow the issue template"

0 commit comments

Comments
 (0)