Fix branch conflicts (#7)

* Add branch check

* Improve docs
This commit is contained in:
Federico Grandi
2019-12-07 20:50:05 +01:00
committed by GitHub
parent 98ce691ee3
commit cf96c454b6
2 changed files with 29 additions and 4 deletions

View File

@@ -37,9 +37,15 @@ then
git fetch
# Switch to branch from current Workflow run
echo "Creating and switching branch..."
git branch "${GITHUB_REF:11}"
# Verify if the branch needs to be created
if ! git rev-parse --verify --quiet "${GITHUB_REF:11}"
then
echo "Creating branch..."
git branch "${GITHUB_REF:11}"
fi
# Switch to branch from current workflow run
echo "Switching branch..."
git checkout "${GITHUB_REF:11}"
echo "Adding files..."