Skip to content

close_stale_pull_requests #1427

close_stale_pull_requests

close_stale_pull_requests #1427

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@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit
- uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.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 }}