From f9cbe43627ed5586facfb3e515f9c44ecd34fd30 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Tue, 14 Jun 2022 10:24:44 +1000 Subject: [PATCH] [PIQ-3] Add Github Actions to help manage issues and PRs (#1948) * Add automatic responses and stale Github Actions --- .../workflows/automatic-issue-responses.yml | 64 +++++++++++++++++++ .github/workflows/stale-bot.yml | 30 +++++++++ 2 files changed, 94 insertions(+) create mode 100644 .github/workflows/automatic-issue-responses.yml create mode 100644 .github/workflows/stale-bot.yml diff --git a/.github/workflows/automatic-issue-responses.yml b/.github/workflows/automatic-issue-responses.yml new file mode 100644 index 000000000..970532ab1 --- /dev/null +++ b/.github/workflows/automatic-issue-responses.yml @@ -0,0 +1,64 @@ +--- +name: Automatic responses +on: + issues: + types: + - labeled +jobs: + close-issue: + name: 'Close issue with automatic response' + runs-on: ubuntu-20.04 + permissions: + issues: write + steps: + # Feature request + - if: github.event.label.name == 'feature-request' + name: Feature request + uses: peter-evans/close-issue@849549ba7c3a595a064c4b2c56f206ee78f93515 # v2.0.0 + with: + comment: | + We use GitHub issues as a place to track bugs and other development related issues. The [Bitwarden Community Forums](https://community.bitwarden.com/) has a [Feature Requests](https://community.bitwarden.com/c/feature-requests) section for submitting, voting for, and discussing requests like this one. + + Please [sign up on our forums](https://community.bitwarden.com/signup) and search to see if this request already exists. If so, you can vote for it and contribute to any discussions about it. If not, you can re-create the request there so that it can be properly tracked. + + This issue will now be closed. Thanks! + # Intended behavior + - if: github.event.label.name == 'intended-behavior' + name: Intended behaviour + uses: peter-evans/close-issue@849549ba7c3a595a064c4b2c56f206ee78f93515 # v2.0.0 + with: + comment: | + Your issue appears to be describing the intended behavior of the software. If you want this to be changed, it would be a feature request. + + We use GitHub issues as a place to track bugs and other development related issues. The [Bitwarden Community Forums](https://community.bitwarden.com/) has a [Feature Requests](https://community.bitwarden.com/c/feature-requests) section for submitting, voting for, and discussing requests like this one. + + Please [sign up on our forums](https://community.bitwarden.com/signup) and search to see if this request already exists. If so, you can vote for it and contribute to any discussions about it. If not, you can re-create the request there so that it can be properly tracked. + + This issue will now be closed. Thanks! + # Customer support request + - if: github.event.label.name == 'customer-support' + name: Customer Support request + uses: peter-evans/close-issue@849549ba7c3a595a064c4b2c56f206ee78f93515 # v2.0.0 + with: + comment: | + We use GitHub issues as a place to track bugs and other development related issues. Your issue appears to be a support request, or would otherwise be better handled by our dedicated Customer Success team. + + Please contact us using our [Contact page](https://bitwarden.com/contact). You can include a link to this issue in the message content. + + Alternatively, you can also search for an answer in our [help documentation](https://bitwarden.com/help/) or get help from other Bitwarden users on our [community forums](https://community.bitwarden.com/c/support/). The issue here will be closed. + # Resolved + - if: github.event.label.name == 'resolved' + name: Resolved + uses: peter-evans/close-issue@849549ba7c3a595a064c4b2c56f206ee78f93515 # v2.0.0 + with: + comment: | + We’ve closed this issue, as it appears the original problem has been resolved. If this happens again or continues to be an problem, please respond to this issue with any additional detail to assist with reproduction and root cause analysis. + # Stale + - if: github.event.label.name == 'stale' + name: Stale + uses: peter-evans/close-issue@849549ba7c3a595a064c4b2c56f206ee78f93515 # v2.0.0 + with: + comment: | + As we haven’t heard from you about this problem in some time, this issue will now be closed. + + If this happens again or continues to be an problem, please respond to this issue with any additional detail to assist with reproduction and root cause analysis. diff --git a/.github/workflows/stale-bot.yml b/.github/workflows/stale-bot.yml new file mode 100644 index 000000000..5cd154cf2 --- /dev/null +++ b/.github/workflows/stale-bot.yml @@ -0,0 +1,30 @@ +--- +name: 'Close stale issues and PRs' +on: + workflow_dispatch: + schedule: # Run once a day at 5.23am (arbitrary but should avoid peak loads on the hour) + - cron: '23 5 * * *' + +jobs: + stale: + name: 'Check for stale issues and PRs' + runs-on: ubuntu-20.04 + steps: + - name: 'Run stale action' + uses: actions/stale@3cc123766321e9f15a6676375c154ccffb12a358 # v5.0.0 + with: + stale-issue-label: 'needs-reply' + stale-pr-label: 'needs-changes' + days-before-stale: -1 # Do not apply the stale labels automatically, this is a manual process + days-before-issue-close: 14 # Close issue if no further activity after X days + days-before-pr-close: 21 # Close PR if no further activity after X days + close-issue-message: | + We need more information before we can help you with your problem. As we haven’t heard from you recently, this issue will be closed. + + If this happens again or continues to be an problem, please respond to this issue with the information we’ve requested and anything else relevant. + close-pr-message: | + We can’t merge your pull request until you make the changes we’ve requested. As we haven’t heard from you recently, this pull request will be closed. + + If you’re still working on this, please respond here after you’ve made the changes we’ve requested and our team will re-open it for further review. + + Please make sure to resolve any conflicts with the master branch before requesting another review.