Skip to content

Commit

Permalink
chore: a stalebot to close inactive issues and PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher committed Dec 8, 2022
1 parent 582397a commit 19e486d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 41 deletions.
41 changes: 0 additions & 41 deletions .github/stale.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/manage-stale-issues-and-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Manage stale issues and PRs"
on:
# Chosen to be just before London wakes up and way past San Francisco's bedtime.
schedule:
- cron: "0 8 * * 1-5" # This is in UTC.
# Do a dry-run (debug-only: true) whenever this workflow itself is changed.
pull_request:
paths:
- .github/workflows/manage-stale-issues-and-prs.yml
types:
- opened
- synchronize

permissions:
issues: write
pull-requests: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v6
with:
ascending: true # Spend API operations budget on older, more-likely-to-get-closed issues first
close-issue-message: "" # Leave no comment when closing
close-pr-message: "" # Leave no comment when closing
days-before-issue-stale: 7
days-before-pr-stale: 14
days-before-close: 7
debug-only: ${{ github.event_name == 'pull_request' }} # Dry-run when true.
exempt-all-milestones: true # Milestones can sometimes last a month, so exempt issues attached to a milestone.
exempt-issue-labels: blocked,do-not-close,feature-gate,security
exempt-pr-labels: blocked,do-not-close,feature-gate,security
# No actual changes get made in debug-only mode, so we can raise the operations ceiling.
operations-per-run: ${{ github.event_name == 'pull_request' && 100 || 30}}
stale-issue-label: stale
stale-issue-message: "" # Leave no comment when marking as stale
stale-pr-label: stale
stale-pr-message: "" # Leave no comment when marking as stale
# Time immemorial when in debug-only mode (ie. on pull requests).
# `STALEBOT_START_DATE` otherwise.
# You can use this as a killswitch by setting `STALEBOT_START_DATE` in the far future.
start-date: ${{ github.event_name == 'pull_request' && '1970-01-01T00:00:00Z' || secrets.STALEBOT_START_DATE }} # ISO 8601 or RFC 2822

0 comments on commit 19e486d

Please sign in to comment.