Skip to content

close_stale_pull_requests #1524

close_stale_pull_requests

close_stale_pull_requests #1524

name: close_stale_pull_requests
on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch: {}
permissions: read-all
jobs:
close_stale_pull_requests:
runs-on: ubuntu-24.04
permissions:
pull-requests: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1
with:
egress-policy: audit
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
with:
days-before-stale: 30
# Do not handle issues at all. We only want to handle PRs.
days-before-issue-stale: -1
stale-pr-message: |
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
- Push additional commits to the associated branch.
- Remove the stale label.
- Add a comment indicating why it is not stale.
If no action is taken within 7 days, this PR will be closed.
close-pr-message: "This PR was closed because it has been stale for 7 days with no activity."
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}