File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,9 @@ GitHub Action for backup your git repository.
16
16
17
17
## Environment Variables
18
18
19
- - ` GIT_DEPLOY_KEY ` - * Required* your deploy key (ssh private key) which has ** Write access**
20
- - ` TARGET_GIT ` : ** required** , your backup git repository (please use ssh or git protocol)
19
+ - ` GIT_DEPLOY_KEY ` : ** Required** , your deploy key (ssh private key) which has ** Write access**
20
+ - ` TARGET_GIT ` : ** required** , your backup git repository (please use ssh or git protocol)
21
+ - ` BRANCH ` : ** required** , the branch you want to backup
21
22
22
23
```
23
24
name: Backup Git Repository
37
38
env:
38
39
GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
39
40
TARGET_GIT: "[email protected] :surenpi/surenpi.git"
41
+ BRANCH: master
40
42
```
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 master
15
+ git checkout ${BRANCH}
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 master -f
23
+ git push backup ${BRANCH} -f
24
24
git remote remove backup
You can’t perform that action at this time.
0 commit comments