Add double quotes

TARGET_BRANCH cannot have spaces currently but adding double shell for
consistent style.

GITHUB_USERNAME probably cannot have spaces but just for consistency
(and in case that it can have spaces)
This commit is contained in:
Carles Pina i Estany 2020-09-23 09:53:20 +01:00
parent 160c443d67
commit 5d8dc0fe1a

View File

@ -10,7 +10,7 @@ TARGET_BRANCH="$6"
if [ -z "$REPO_USERNAME" ] if [ -z "$REPO_USERNAME" ]
then then
REPO_USERNAME=$GITHUB_USERNAME REPO_USERNAME="$GITHUB_USERNAME"
fi fi
if [ -z "$TARGET_BRANCH" ] if [ -z "$TARGET_BRANCH" ]
then then
@ -23,7 +23,7 @@ echo "Cloning destination git repository"
# Setup git # Setup git
git config --global user.email "$USER_EMAIL" git config --global user.email "$USER_EMAIL"
git config --global user.name "$GITHUB_USERNAME" git config --global user.name "$GITHUB_USERNAME"
git clone --single-branch --branch $TARGET_BRANCH "https://$API_TOKEN_GITHUB@github.com/$REPO_USERNAME/$GITHUB_REPO.git" "$CLONE_DIR" git clone --single-branch --branch "$TARGET_BRANCH" "https://$API_TOKEN_GITHUB@github.com/$REPO_USERNAME/$GITHUB_REPO.git" "$CLONE_DIR"
ls -la "$CLONE_DIR" ls -la "$CLONE_DIR"
echo "Cleaning destination repository of old files" echo "Cleaning destination repository of old files"
@ -42,4 +42,4 @@ git status
git commit --message "Update from https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA" git commit --message "Update from https://github.com/$GITHUB_REPOSITORY/commit/$GITHUB_SHA"
echo "Pushing git commit" echo "Pushing git commit"
git push origin $TARGET_BRANCH git push origin "$TARGET_BRANCH"