From ecd6be7506e179714fe9899d65b8e82120aadcea Mon Sep 17 00:00:00 2001 From: Stadicus Date: Fri, 10 Dec 2021 11:57:55 +0100 Subject: [PATCH] github-actions: warn and auto-close issues & prs (#833) * github-actions: warn and auto-close issues & prs Support is given on a best-effort basis. In my experience, issues quickly become irrelevant and even if help is finally provided with some delay, the original author no longer comes back. The same goes for pull requests that don't gain any traction. They become outdated, although on a longer time scale. To keep open issues and pull requests relevant, it's good practice to close stale ones. GitHub actions provides a bot that does this automatically, giving a warning first (marking the item as 'stale'), and then automatically closes it later. This change proposes to mark issues as stale after 60 days of inactivity, and close them one week after, if no activity occurs. Pull requests are marked as stale after 90 days without any interaction, and automatically closed 30 days later in case of inactivity. * fix: 30 days after stale for pr --- .github/workflows/stale.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..49902f333 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,34 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '31 * * * *' + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-issue-stale: 60 + days-before-issue-close: 7 + stale-issue-message: 'This issue is marked as `stale` because there was no activity for 60 days. If the issue stays inactive, it will be closed in a week.' + stale-issue-label: 'stale' + close-issue-message: 'This issue has been closed due to inactivity.' + + days-before-pr-stale: 90 + days-before-pr-close: 30 + stale-pr-message: 'This pull request is marked as `stale` because there was no activity for 90 days. If the pull request stays inactive, it will be closed automatically in 30 days.' + stale-pr-label: 'stale' + close-pr-message: 'This pull request has been closed due to inactivity.'