Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/stalebot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *' # Runs at 1:30 AM UTC every day

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
Comment on lines +6 to +10

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Declare permissions so stalebot can write to issues and PRs

The actions/stale step labels and closes issues and pull requests, but this workflow never requests write access for the GITHUB_TOKEN. With only a scheduled trigger and no explicit permissions block, the job inherits the repository default, which is read‑only in most repos. When the job runs it will fail with Resource not accessible by integration and nothing will be marked stale or closed. Add a permissions: { issues: write, pull-requests: write } stanza at the workflow or job level so the bot can apply labels and close items.

Useful? React with 👍 / 👎.

with:
# Issues config
stale-issue-message: 'This issue has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.'
close-issue-message: 'This issue was closed because it has been inactive for 14 days since being marked as stale.'
days-before-issue-stale: 60
days-before-issue-close: 14

# Pull request config
stale-pr-message: 'This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.'
close-pr-message: 'This PR was closed because it has been inactive for 1 day since being marked as stale.'
days-before-pr-stale: 2
days-before-pr-close: 1

# General config
exempt-issue-labels: 'pinned,security,help-wanted'
exempt-pr-labels: 'pinned,security,help-wanted'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
operations-per-run: 100
Loading