File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -10,22 +10,16 @@ jobs:
10
10
runs-on : ubuntu-latest
11
11
12
12
steps :
13
- - name : Checkout all branches
14
- uses : actions/checkout@v4
15
- with :
16
- fetch-depth : 0 # Fetch all history for all branches
17
-
18
13
- name : Set backup filename
19
14
run : echo "BACKUP_FILE=$(echo \"${{ github.repository }}-backup-$(date +%F).tar.gz\" | sed 's/\//-/g')" >> $GITHUB_ENV
20
15
16
+ - name : Clone the repository (mirror all branches and history)
17
+ run : |
18
+ git clone --mirror https://github.com/${{ github.repository }}.git repo-mirror
19
+
21
20
- name : Create backup archive
22
21
run : |
23
- tar --exclude='.git' \
24
- --exclude='.github' \
25
- --exclude='credentials.json' \
26
- --exclude="$BACKUP_FILE" \
27
- --warning=no-file-changed \
28
- -czf "$BACKUP_FILE" . || [ $? -eq 1 ]
22
+ tar -czvf "$BACKUP_FILE" repo-mirror
29
23
30
24
- name : Check if backup archive exists
31
25
run : |
61
55
62
56
- name : Clean up
63
57
run : |
58
+ rm -rf repo-mirror
64
59
rm -f "$BACKUP_FILE"
65
60
rm -f credentials.json
You can’t perform that action at this time.
0 commit comments