Skip to content

Commit

Permalink
Add pseudo credentials to continue on clone fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Gruber committed Sep 15, 2024
1 parent a1e3c04 commit 17b3388
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clone_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ REPOSITORY_DIR="${CWD}/${PROJECT_NAME}"
debug_echo "Clone Repository into ${REPOSITORY_DIR}"
if [[ $PROJECT_URL == http* ]]
then
git clone "${PROJECT_URL}" "${REPOSITORY_DIR}"
# Add pseudo credentials to avoid git asking for username and password
PROJECT_URL_AUTH=$(echo $PROJECT_URL | sed "s/:\/\//:\/\/foo:foo@/g")
git clone "${PROJECT_URL_AUTH}" "${REPOSITORY_DIR}"
if [[ -n "$PROJECT_HASH" ]]; then
cd "${REPOSITORY_DIR}" || exit 1
git reset --hard "${PROJECT_HASH}" || exit 1
Expand Down

0 comments on commit 17b3388

Please sign in to comment.