Skip to content

Commit

Permalink
Adds automated handling of inactive issues/PRs (dry-run)
Browse files Browse the repository at this point in the history
  • Loading branch information
javulticat committed Jan 13, 2024
1 parent 77689e2 commit b893177
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b893177

Please sign in to comment.