From b8aad0ef4291be00bac003f98e603bb886ccade3 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Fri, 17 Nov 2023 13:21:24 +0100 Subject: [PATCH] Set up GitHub Actions to automatically close and lock issues (#1920) * add workflow to close inactive issues * add workflow to lock closed issues --- .github/workflows/close-inactive-issues.yaml | 37 ++++++++++++++++++++ .github/workflows/lock-closed-issues.yaml | 31 ++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/close-inactive-issues.yaml create mode 100644 .github/workflows/lock-closed-issues.yaml diff --git a/.github/workflows/close-inactive-issues.yaml b/.github/workflows/close-inactive-issues.yaml new file mode 100644 index 000000000..c5c21c113 --- /dev/null +++ b/.github/workflows/close-inactive-issues.yaml @@ -0,0 +1,37 @@ +# This workflow is based on a very similar one from Flutter +# https://github.com/flutter/flutter/blob/3.16.0/.github/workflows/no-response.yaml + +name: close inactive issues + +on: + issue_comment: + types: [created] + schedule: + - cron: '0 * * * *' + +permissions: + issues: write + +jobs: + main: + runs-on: ubuntu-latest + if: ${{ github.repository == 'leancodepl/patrol' }} + steps: + - uses: godofredoc/no-response@0ce2dc0e63e1c7d2b87752ceed091f6d32c9df09 + with: + token: ${{ github.token }} + closeComment: > + Without additional information, we can't resolve this issue. We're + therefore reluctantly going to close it. + + Feel free to open a new issue with all the required information + provided, including a [minimal, reproducible sample]. Make sure to + diligently fill out the issue template. + + Thanks for your contribution. + + [minimal, reproducible sample]: https://stackoverflow.com/help/minimal-reproducible-example + # Number of days of inactivity before an issue is closed. + daysUntilClose: 7 + # Only issues with this label will be closed (if they are inactive). + responseRequiredLabel: waiting for response diff --git a/.github/workflows/lock-closed-issues.yaml b/.github/workflows/lock-closed-issues.yaml new file mode 100644 index 000000000..692385b99 --- /dev/null +++ b/.github/workflows/lock-closed-issues.yaml @@ -0,0 +1,31 @@ +# This workflow is copied from Flutter +# https://github.com/flutter/flutter/blob/3.16.0/.github/workflows/lock.yaml + +name: lock closed issues + +permissions: + issues: write + +on: + schedule: + - cron: '0 * * * *' + +jobs: + lock: + permissions: + issues: write + runs-on: ubuntu-latest + if: ${{ github.repository == 'leancodepl/patrol' }} + steps: + - uses: dessant/lock-threads@v5 + with: + process-only: issues + github-token: ${{ github.token }} + # Number of days of inactivity before a closed issue is locked. + issue-inactive-days: 7 + issue-comment: > + This issue has been automatically locked since there has not been + any recent activity after it was closed. If you are still + experiencing a similar problem, please file a new issue. Make + sure to follow the template and provide all the information + necessary to reproduce the issue.