mirror of
https://github.com/github/spec-kit.git
synced 2026-07-03 12:28:06 +08:00
The actions/stale@v10 action uses GitHub Actions cache to persist state across runs. Without the actions:write permission, the action can write cache entries but cannot delete them (403 error on cache cleanup). This causes a vicious cycle: once an issue is processed and cached, the action skips it on every future run with 'issue skipped due being processed during the previous run' - so stale issues never reach the closing logic after being marked stale. Adding actions:write allows the action to properly manage its cache lifecycle, enabling stale issues to be closed after the configured 30-day close window.
44 lines
1.9 KiB
YAML
44 lines
1.9 KiB
YAML
name: 'Close stale issues and PRs'
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 0 * * *' # Run daily at midnight UTC
|
|
workflow_dispatch: # Allow manual triggering
|
|
|
|
permissions:
|
|
actions: write
|
|
issues: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
stale:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/stale@v10
|
|
with:
|
|
# Days of inactivity before an issue or PR becomes stale
|
|
days-before-stale: 150
|
|
# Days of inactivity before a stale issue or PR is closed (after being marked stale)
|
|
days-before-close: 30
|
|
|
|
# Stale issue settings
|
|
stale-issue-message: 'This issue has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs.'
|
|
close-issue-message: 'This issue has been automatically closed due to inactivity (180 days total). If you believe this issue is still relevant, please reopen it or create a new issue.'
|
|
stale-issue-label: 'stale'
|
|
|
|
# Stale PR settings
|
|
stale-pr-message: 'This pull request has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs.'
|
|
close-pr-message: 'This pull request has been automatically closed due to inactivity (180 days total). If you believe this PR is still relevant, please reopen it or create a new PR.'
|
|
stale-pr-label: 'stale'
|
|
|
|
# Exempt issues and PRs with these labels from being marked as stale
|
|
exempt-issue-labels: 'pinned,security'
|
|
exempt-pr-labels: 'pinned,security'
|
|
|
|
# Only issues or PRs with all of these labels are checked
|
|
# Leave empty to check all issues and PRs
|
|
any-of-labels: ''
|
|
|
|
# Operations per run (helps avoid rate limits)
|
|
operations-per-run: 250
|