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.
1616
1717## Environment Variables
1818
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
2122
2223```
2324name: Backup Git Repository
3738 env:
3839 GIT_DEPLOY_KEY: ${{ secrets.GIT_DEPLOY_KEY }}
3940 TARGET_GIT: "[email protected] :surenpi/surenpi.git" 41+ BRANCH: master
4042```
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ git config --global --add safe.directory /github/workspace
1212
1313git version
1414git fetch --unshallow origin
15- git checkout master
15+ git checkout ${BRANCH}
1616git status
1717git remote add backup ${TARGET_GIT}
1818git remote -vv
1919git config --global --add safe.directory /github/workspace
2020git config --global user.name " ${GITHUB_ACTOR} "
2121git config --global user.email " ${GITHUB_ACTOR} @users.noreply.github.com"
2222echo ' ready to push'
23- git push backup master -f
23+ git push backup ${BRANCH} -f
2424git remote remove backup
You can’t perform that action at this time.
0 commit comments