-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (44 loc) · 1.63 KB
/
housekeeping.yaml
File metadata and controls
52 lines (44 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Handle stale PRs
on:
schedule:
- cron: '42 1 * * *'
jobs:
prs:
name: Clean up stale prs
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
repo-token: ${{ github.token }}
operations-per-run: 200
stale-pr-message: 'This PR is considered to be stale. It has been open 20 days with no further activity thus it is going to be closed in 10 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.'
days-before-pr-stale: 20
days-before-pr-close: 10
stale-pr-label: 'Stale'
branches:
name: Cleanup old branches
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
fetch-depth: 0
- name: Run branch cleanup script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
chmod +x ./scripts/cleanup-old-branches.sh
./scripts/cleanup-old-branches.sh \
--months 2 \
--protected-branches "^(main|develop)$"