From 214cf1024e6240e36c54e608706bda5e0b0d4a1b Mon Sep 17 00:00:00 2001 From: Gabriele Ara Date: Tue, 16 Nov 2021 13:57:20 +0100 Subject: [PATCH] Using DESTINATION_GITHUB_USERNAME instead of USER_NAME for cloning and pushing --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 9d0b836..135c27e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -32,7 +32,7 @@ echo "[+] Cloning destination git repository $DESTINATION_REPOSITORY_NAME" # Setup git git config --global user.email "$USER_EMAIL" git config --global user.name "$USER_NAME" -git clone --single-branch --branch "$TARGET_BRANCH" "https://$USER_NAME:$API_TOKEN_GITHUB@$GITHUB_SERVER/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git" "$CLONE_DIR" +git clone --single-branch --branch "$TARGET_BRANCH" "https://$DESTINATION_GITHUB_USERNAME:$API_TOKEN_GITHUB@$GITHUB_SERVER/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git" "$CLONE_DIR" ls -la "$CLONE_DIR" TEMP_DIR=$(mktemp -d) @@ -104,4 +104,4 @@ git diff-index --quiet HEAD || git commit --message "$COMMIT_MESSAGE" echo "[+] Pushing git commit" # --set-upstream: sets de branch when pushing to a branch that does not exist -git push "https://$USER_NAME:$API_TOKEN_GITHUB@$GITHUB_SERVER/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git" --set-upstream "$TARGET_BRANCH" +git push "https://$DESTINATION_GITHUB_USERNAME:$API_TOKEN_GITHUB@$GITHUB_SERVER/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git" --set-upstream "$TARGET_BRANCH"