File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ GitHub Action for backup your git repository.
18
18
19
19
- ` GIT_DEPLOY_KEY ` : ** Required** , your deploy key (ssh private key) which has ** Write access**
20
20
- ` TARGET_GIT ` : ** required** , your backup git repository (please use ssh or git protocol)
21
- - ` BRANCH ` : ** required ** , the branch you want to backup
21
+ - ` BRANCH ` : ** optional ** , the branch you want to backup (default value is ` master ` )
22
22
23
23
```
24
24
name: Backup Git Repository
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ git config --global --add safe.directory /github/workspace
12
12
13
13
git version
14
14
git fetch --unshallow origin
15
- git checkout ${BRANCH}
15
+ git checkout ${BRANCH:- master }
16
16
git status
17
17
git remote add backup ${TARGET_GIT}
18
18
git remote -vv
19
19
git config --global --add safe.directory /github/workspace
20
20
git config --global user.name " ${GITHUB_ACTOR} "
21
21
git config --global user.email " ${GITHUB_ACTOR} @users.noreply.github.com"
22
22
echo ' ready to push'
23
- git push backup ${BRANCH} -f
23
+ git push backup ${BRANCH:- master } -f
24
24
git remote remove backup
You can’t perform that action at this time.
0 commit comments