Skip to content

Commit b2454c2

Browse files
authored
GH Action to Remove Stale Branches (#2404)
added workflow
1 parent 11c653c commit b2454c2

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Remove Stale Branches (DRY-RUN)
2+
3+
on:
4+
schedule:
5+
- cron: "0 9 * * *" # every day at 09:00 UTC
6+
workflow_dispatch: {} # manual run button
7+
8+
permissions:
9+
contents: write
10+
actions: read
11+
pull-requests: read
12+
13+
concurrency:
14+
group: remove-stale-branches
15+
cancel-in-progress: false
16+
17+
jobs:
18+
sweep:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Preview stale branches
22+
uses: fpicalausa/remove-stale-branches@v2
23+
with:
24+
dry-run: true
25+
# curr threshold is >= 2 years
26+
days-before-branch-stale: 730
27+
days-before-branch-delete: 2
28+
ignore-branches-with-open-prs: false
29+
exempt-protected-branches: true
30+
exempt-branches-regex: "^(main|master|develop|dev|ros2|release/.+)$"
31+
operations-per-run: 200
32+
restrict-branches-regex: "^.*$"

0 commit comments

Comments
 (0)