forked from arc90/git-sweep
-
Notifications
You must be signed in to change notification settings - Fork 1
/
preview.yml
47 lines (39 loc) · 1.13 KB
/
preview.yml
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
name: Test Auto Delete
on:
push:
branches: [ test-auto-delete ]
pull_request:
branches: [ test-auto-delete ]
workflow_dispatch:
jobs:
build:
runs-on: "ubuntu-latest"
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
# You have to checkout master to back up the entire repo
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: git checkout master
# This is where the backup happens
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d%H%M')"
- name: Backup git
run: git bundle create repo.bundle --all
- name: Backup Repo to Artifact for 30 days
uses: actions/upload-artifact@v2
with:
name: repo-zip-${{ steps.date.outputs.date }}
path: repo.bundle
retention-days: 30
# This is where the backup happens
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- name: Git Sweep Merged and Stale
uses: rodvdka/git-sweep-merged-and-stale@latest
with:
delete_stale_after_days: 180