mirror of
https://github.com/cpina/github-action-push-to-another-repository.git
synced 2024-12-22 08:06:10 -07:00
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:
parent
160c443d67
commit
5d8dc0fe1a
|
@ -10,7 +10,7 @@ TARGET_BRANCH="$6"
|
|||
|
||||
if [ -z "$REPO_USERNAME" ]
|
||||
then
|
||||
REPO_USERNAME=$GITHUB_USERNAME
|
||||
REPO_USERNAME="$GITHUB_USERNAME"
|
||||
fi
|
||||
if [ -z "$TARGET_BRANCH" ]
|
||||
then
|
||||
|
@ -23,7 +23,7 @@ echo "Cloning destination git repository"
|
|||
# Setup git
|
||||
git config --global user.email "$USER_EMAIL"
|
||||
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"
|
||||
|
||||
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"
|
||||
|
||||
echo "Pushing git commit"
|
||||
git push origin $TARGET_BRANCH
|
||||
git push origin "$TARGET_BRANCH"
|
||||
|
|
Loading…
Reference in New Issue
Block a user