Merge pull request #95 from StrongMonkey/master

Creating orphan branch
This commit is contained in:
Stefan Zweifel 2020-09-10 19:44:31 +02:00 committed by GitHub
commit 5c3c72f20e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -x
_main() { _main() {
_switch_to_repository _switch_to_repository
@ -39,8 +40,13 @@ _git_is_dirty() {
_switch_to_branch() { _switch_to_branch() {
echo "INPUT_BRANCH value: $INPUT_BRANCH"; echo "INPUT_BRANCH value: $INPUT_BRANCH";
# Switch to branch from current Workflow run if git show-ref --verify --quiet refs/heads/$INPUT_BRANCH; then
git checkout $INPUT_BRANCH; # Switch to branch from current Workflow run
git checkout $INPUT_BRANCH;
else
git checkout --orphan $INPUT_BRANCH
git rm -rf .
fi
} }
_add_files() { _add_files() {