We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d19570d commit 4b31377Copy full SHA for 4b31377
.github/workflows/ghpages-cleanup.yml
@@ -0,0 +1,27 @@
1
+on:
2
+ schedule:
3
+ - cron: 0 0 * * 6 # midnight on Saturdays
4
+ workflow_dispatch:
5
+
6
+jobs:
7
+ cleanup:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - name: Check out GH Pages branch
11
+ uses: actions/checkout
12
+ with:
13
+ # replace `fetch-depth` with `shallow-since` if and when actions/checkout#619 (or an equivalent) gets merged
14
+ fetch-depth: 0
15
+ ref: gh-pages
16
+ - name: Mark stale directories for removal
17
+ run: |
18
+ for dir in */; do
19
+ if [ -z "$(git log -n 1 --since "1 month ago" -- "$dir")" ]; then
20
+ git rm -r "$dir"
21
+ fi
22
+ done
23
+ git status
24
+ - name: Commit
25
+ run: "git commit -m 'chore: remove stale GH Pages branches'"
26
+ - name: Push
27
+ run: "git push"
0 commit comments