Skip to content

Commit

Permalink
provide a default value of the branch
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxSuRen committed Nov 17, 2022
1 parent b332146 commit b074e9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GitHub Action for backup your git repository.

- `GIT_DEPLOY_KEY`: **Required**, your deploy key (ssh private key) which has **Write access**
- `TARGET_GIT`: **required**, your backup git repository (please use ssh or git protocol)
- `BRANCH`: **required**, the branch you want to backup
- `BRANCH`: **optional**, the branch you want to backup (default value is `master`)

```
name: Backup Git Repository
Expand Down
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ git config --global --add safe.directory /github/workspace

git version
git fetch --unshallow origin
git checkout ${BRANCH}
git checkout ${BRANCH:-master}
git status
git remote add backup ${TARGET_GIT}
git remote -vv
git config --global --add safe.directory /github/workspace
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
echo 'ready to push'
git push backup ${BRANCH} -f
git push backup ${BRANCH:-master} -f
git remote remove backup

0 comments on commit b074e9a

Please sign in to comment.