Skip to content

Close stale PRs

Close stale PRs #152

name: 'Close stale PRs'
on:
schedule:
# runs every day at midnight (UTC time).
- cron: '0 0 * * *'
env:
DAY_BEFORE_STALE: 30
DAY_BEFORE_CLOSE: 15
EXEMPT_LABELS: "Ignore Stale,External PR"
jobs:
stale:
runs-on: ubuntu-latest
if: github.repository == 'demisto/content' && github.event.pull_request.head.repo.fork == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Stale
uses: actions/stale@v8
with:
repo-token: ${{ secrets.CONTENTBOT_GH_ADMIN_TOKEN }}
days-before-issue-stale: -1
days-before-issue-close: -1
days-before-pr-stale: ${{env.DAY_BEFORE_STALE}}
days-before-pr-close: ${{env.DAY_BEFORE_CLOSE}}
stale-pr-message: "This PR is marked as 'Stale' because it has been open for ${{env.DAY_BEFORE_STALE}} days with no activity, it will be automatically closed in ${{env.DAY_BEFORE_CLOSE}} days if no activity will be done. To reset the counter just remove the 'Stale' label or make changes to update this PR. If you wish this PR will never be marked as 'Stale' add the 'Ignore Stale'"
delete-branch: true
remove-pr-stale-when-updated: true
exempt-pr-labels: ${{env.EXEMPT_LABELS}}