From b5a230e7caf31cbeb847503fa92e88adb8b89d31 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Mon, 28 Dec 2020 19:05:58 +0100 Subject: [PATCH] Add GitHub workflows --- .github/ISSUE_TEMPLATE/Bug_report.md | 2 +- .github/ISSUE_TEMPLATE/Feature_request.md | 2 +- .github/ISSUE_TEMPLATE/Performance_issue.md | 2 +- .github/ISSUE_TEMPLATE/Question.md | 2 +- .github/issue-commenter.yml | 25 +++++++++++ .github/labeler.yml | 17 ++++++++ .../workflows/close-issues-no-response.yml | 24 +++++++++++ .github/workflows/issue-label-commenter.yml | 14 +++++++ .../issue-label-to-project-board.yml | 42 +++++++++++++++++++ .github/workflows/new-issue-label.yml | 14 +++++++ 10 files changed, 140 insertions(+), 4 deletions(-) create mode 100644 .github/issue-commenter.yml create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/close-issues-no-response.yml create mode 100644 .github/workflows/issue-label-commenter.yml create mode 100644 .github/workflows/issue-label-to-project-board.yml create mode 100644 .github/workflows/new-issue-label.yml diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 3a799053..abd99f61 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -8,7 +8,7 @@ about: If something is not working as expected or crashes #### Issue type: -- :bug: Bug +- :bug: Bug ____ diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md index 5e557749..30eac153 100644 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -8,7 +8,7 @@ about: Suggest an idea for this project #### Issue type: -- :heavy_plus_sign: Feature request +- :heavy_plus_sign: Feature request ____ diff --git a/.github/ISSUE_TEMPLATE/Performance_issue.md b/.github/ISSUE_TEMPLATE/Performance_issue.md index cd4d2400..4cd7a5cd 100644 --- a/.github/ISSUE_TEMPLATE/Performance_issue.md +++ b/.github/ISSUE_TEMPLATE/Performance_issue.md @@ -8,7 +8,7 @@ about: An issue with the performance of this mod, such as abnormal lag. #### Issue type: -- :snail: Performance issue +- :snail: Performance issue ____ diff --git a/.github/ISSUE_TEMPLATE/Question.md b/.github/ISSUE_TEMPLATE/Question.md index edba0a48..21d33d7f 100644 --- a/.github/ISSUE_TEMPLATE/Question.md +++ b/.github/ISSUE_TEMPLATE/Question.md @@ -8,7 +8,7 @@ about: A general question #### Issue type: -- :question: Question +- :question: Question ____ diff --git a/.github/issue-commenter.yml b/.github/issue-commenter.yml new file mode 100644 index 00000000..6df1f0eb --- /dev/null +++ b/.github/issue-commenter.yml @@ -0,0 +1,25 @@ +labels: + - name: bug + labeled: + issue: + body: Thanks for reporting! + - name: feature + labeled: + issue: + body: Thanks for the suggestion! + - name: feature-long-term + labeled: + issue: + body: Thanks for the suggestion! + - name: performance + labeled: + issue: + body: Thanks for reporting! + - name: question + labeled: + issue: + body: Someone will answer your question soon. In the meantime, you might be able to get help more quickly on our [Discord server](https://discord.gg/9yDxubB). + - name: invalid-template + labeled: + issue: + body: '@{{ issue.user.login }} Your issue appears to be not following one of the allowed issue templates, which breaks our automation tools. Please update your issue to the proper template.' diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..136974cf --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,17 @@ +bug: + - '- :bug: Bug' +feature-long-term: + - '- :heavy_plus_sign: Feature request' +performance: + - '- :snail: Performance issue' +question: + - '- :question: Question' + +mc-1.12: + - 'Minecraft: 1.12' +mc-1.14: + - 'Minecraft: 1.14' +mc-1.15: + - 'Minecraft: 1.15' +mc-1.16: + - 'Minecraft: 1.16' diff --git a/.github/workflows/close-issues-no-response.yml b/.github/workflows/close-issues-no-response.yml new file mode 100644 index 00000000..ed85a39c --- /dev/null +++ b/.github/workflows/close-issues-no-response.yml @@ -0,0 +1,24 @@ +name: "Close issues that received no response" +on: + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + stale-issue-label: "more-information-needed" + stale-issue-message: 'This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we do not have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.' + days-before-close: 14 + days-before-stale: -1 + - uses: actions/stale@v3 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + only-labels: "invalid-template" + stale-issue-label: "invalid-template" + stale-issue-message: 'This issue has been automatically closed because it does not follow the issue template. Feel free to recreate this issue' + days-before-close: 7 + days-before-stale: -1 diff --git a/.github/workflows/issue-label-commenter.yml b/.github/workflows/issue-label-commenter.yml new file mode 100644 index 00000000..5339ef30 --- /dev/null +++ b/.github/workflows/issue-label-commenter.yml @@ -0,0 +1,14 @@ +name: "Comment on issues by label" +on: + issues: + types: [labeled] + +jobs: + comment: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - uses: peaceiris/actions-label-commenter@v1 + with: + github_token: ${{ secrets.PAT }} + config_file: .github/issue-commenter.yml diff --git a/.github/workflows/issue-label-to-project-board.yml b/.github/workflows/issue-label-to-project-board.yml new file mode 100644 index 00000000..4bd3575f --- /dev/null +++ b/.github/workflows/issue-label-to-project-board.yml @@ -0,0 +1,42 @@ +name: "Add labeled issues to project board" +on: + issues: + types: [labeled] + +env: + MY_GITHUB_TOKEN: ${{ secrets.PAT }} + +jobs: + assign: + runs-on: ubuntu-latest + steps: + - name: Maintenance Issues + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + contains(github.event.issue.labels.*.name, 'bug') || + contains(github.event.issue.labels.*.name, 'performance') || + contains(github.event.issue.labels.*.name, 'question') + with: + project: 'https://github.com/orgs/CyclopsMC/projects/1' + column_name: 'To Do' + - name: Feature Optional + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + contains(github.event.issue.labels.*.name, 'feature-long-term') + with: + project: 'https://github.com/orgs/CyclopsMC/projects/2' + column_name: 'Options' + - name: Feature Accepted + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + contains(github.event.issue.labels.*.name, 'feature') + with: + project: 'https://github.com/orgs/CyclopsMC/projects/2' + column_name: 'Accepted (To Do)' + - name: More Information Needed + uses: srggrs/assign-one-project-github-action@1.2.0 + if: | + contains(github.event.issue.labels.*.name, 'more-information-needed') + with: + project: 'https://github.com/orgs/CyclopsMC/projects/1' + column_name: 'On hold (awaiting input)' diff --git a/.github/workflows/new-issue-label.yml b/.github/workflows/new-issue-label.yml new file mode 100644 index 00000000..96ca3794 --- /dev/null +++ b/.github/workflows/new-issue-label.yml @@ -0,0 +1,14 @@ +name: "Label new issues" +on: + issues: + types: [opened, edited] + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: github/issue-labeler@v2.0 + with: + repo-token: "${{ secrets.PAT }}" + configuration-path: .github/labeler.yml + enable-versioned-regex: 0