Skip to content

Repo cleanup (old PRs, branches and issues) #128

Repo cleanup (old PRs, branches and issues)

Repo cleanup (old PRs, branches and issues) #128

Workflow file for this run

name: Repo cleanup (old PRs, branches and issues)
on:
schedule:
- cron: "0 0 * * *"
# Allow workflow to be manually run from the GitHub UI
workflow_dispatch:
pull_request:
jobs:
cleanup-repository:
runs-on: ubuntu-latest
steps:
# Mark issues and PRs with no activity as stale after a while, and close them after a while longer
- uses: actions/stale@98ed4cb500039dbcccf4bd9bedada4d0187f2757 #v3.0.19
with:
stale-issue-message: 'Marking issue as stale'
stale-pr-message: 'Marking PR as stale'
stale-issue-label: 'stale'
stale-pr-label: 'stale'
days-before-stale: 30
days-before-close: 7
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 #v3.6.0
- uses: ./
id: delete_stuff
with:
github_token: ${{ github.token }}
last_commit_age_days: 0
dry_run: yes
ignore_branches: test_prefix,test_prefix_ignored
branch_limit: 10
only_closed_prs: yes
- name: Get output
run: |
echo "${{ steps.delete_stuff.outputs.deleted_branches }}"