From 9fb10fb8422d88f2ed436023e7287fffd6a5a59f Mon Sep 17 00:00:00 2001 From: Gabriele Ara Date: Fri, 20 May 2022 14:35:21 +0200 Subject: [PATCH] Fixes Issue #68 on cpina repository --- entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 82ad593..df74f26 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -37,11 +37,11 @@ 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" } || { echo "::error::Could not clone the destination repository. Command:" - echo "::error::git clone --single-branch --branch $TARGET_BRANCH https://$USER_NAME:the_api_token@$GITHUB_SERVER/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git $CLONE_DIR" - echo "::error::(Note that the USER_NAME and API_TOKEN is redacted by GitHub)" + echo "::error::git clone --single-branch --branch $TARGET_BRANCH https://$DESTINATION_GITHUB_USERNAME:the_api_token@$GITHUB_SERVER/$DESTINATION_REPOSITORY_USERNAME/$DESTINATION_REPOSITORY_NAME.git $CLONE_DIR" + echo "::error::(Note that the DESTINATION_GITHUB_USERNAME and API_TOKEN is redacted by GitHub)" echo "::error::Please verify that the target repository exist AND that it contains the destination branch name, and is accesible by the API_TOKEN_GITHUB" exit 1 @@ -117,4 +117,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"