Skip to content

Commit b074e9a

Browse files
committed
provide a default value of the branch
1 parent b332146 commit b074e9a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ GitHub Action for backup your git repository.
1818

1919
- `GIT_DEPLOY_KEY`: **Required**, your deploy key (ssh private key) which has **Write access**
2020
- `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`)
2222

2323
```
2424
name: Backup Git Repository

entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ git config --global --add safe.directory /github/workspace
1212

1313
git version
1414
git fetch --unshallow origin
15-
git checkout ${BRANCH}
15+
git checkout ${BRANCH:-master}
1616
git status
1717
git remote add backup ${TARGET_GIT}
1818
git remote -vv
1919
git config --global --add safe.directory /github/workspace
2020
git config --global user.name "${GITHUB_ACTOR}"
2121
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
2222
echo 'ready to push'
23-
git push backup ${BRANCH} -f
23+
git push backup ${BRANCH:-master} -f
2424
git remote remove backup

0 commit comments

Comments
 (0)