From b893177b0180578533f657295e96fd2d163d549f Mon Sep 17 00:00:00 2001 From: Alex DelVecchio Date: Sat, 13 Jan 2024 18:35:35 -0500 Subject: [PATCH] Adds automated handling of inactive issues/PRs (dry-run) --- .github/workflows/maintenance.yml | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/maintenance.yml diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml new file mode 100644 index 000000000..bc450da17 --- /dev/null +++ b/.github/workflows/maintenance.yml @@ -0,0 +1,41 @@ +name: Perform automated repository maintenance + +on: + workflow_dispatch: + schedule: + - cron: "0 */2 * * *" + +jobs: + cleanup-inactive: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + env: + inactive_days: 90 + closing_days: 10 + total_days: 100 + inactive_label: "no-activity" + closed_label: "auto-closed" + steps: + - name: Cleanup inactive issues/PRs + - uses: actions/stale@v9 + with: + days-before-stale: ${{ env.inactive_days }} + days-before-close: ${{ env.close_days }} + stale-issue-label: ${{ env.inactive_label }} + close-issue-label: ${{ env.closed_label }} + exempt-issue-labels: "needs-review,planned,in-progress" + stale-issue-message: "Hi there! Unfortunately, this Issue has not seen any activity for at least ${{ env.inactive_days }} days. If the Issue is still relevant to the [latest version of Zappa](https://github.com/zappa/Zappa/releases/latest), please comment within the next ${{ env.closing_days }} days if you wish to keep it open. Otherwise, it will be automatically closed." + close-issue-message: "Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least ${{ env.total_days }} days. If the Issue is still relevant to the [latest version of Zappa](https://github.com/zappa/Zappa/releases/latest), please [open a new Issue](https://github.com/zappa/Zappa/issues/new)." + stale-pr-label: ${{ env.inactive_label }} + close-pr-label: ${{ env.closed_label }} + exempt-pr-labels: "needs-review" + stale-pr-message: "Hi there! Unfortunately, this PR has not seen any activity for at least ${{ env.inactive_days }} days. If the PR is still relevant to the [latest version of Zappa](https://github.com/zappa/Zappa/releases/latest), please comment within the next ${{ env.closing_days }} days if you wish to keep it open. Otherwise, it will be automatically closed." + close-pr-message: "Hi there! Unfortunately, this PR was automatically closed as it had not seen any activity in at least ${{ env.total_days }} days. If the PR is still relevant to the [latest version of Zappa](https://github.com/zappa/Zappa/releases/latest), please [open a new PR](https://github.com/zappa/Zappa/compare)." + labels-to-add-when-unstale: "needs-review" + ascending: true + enable-statistics: true + # DEBUG OPTIONS + debug-only: true + operations-per-run: 1000