Skip to content

Fix multiple autoclone issues - #434

Open
olevitt wants to merge 1 commit into
mainfrom
fix-git-clone
Open

olevitt wants to merge 1 commit into
mainfrom
fix-git-clone

Conversation

@olevitt

@olevitt olevitt commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Fix 3 issues with the new clone logic :

  • Triple slash (https:///) in the URL

URL_PREFIX evaluates to https:// (which already ends with //).

In your URL construction, you wrote "$URL_PREFIX"/"$GIT_PERSONAL_ACCESS_TOKEN". This adds an extra slash, producing an invalid URL type such as https:///token@github.com/... (instead of https://token@github.com/...).

  • Uninitialized variable bug if the token is absent

If GIT_PERSONAL_ACCESS_TOKEN is empty, the conditional block is skipped, but the CLONE_URL variable is never created. The git clone command will therefore execute without a valid URL. CLONE_URL="$GIT_REPOSITORY" should be initialized by default.

  • Missing quotes (quoting) in the git command

git -C $ROOT_PROJECT_DIRECTORY clone $CLONE_URL --branch $GIT_BRANCH uses unquoted variables. If any path or the branch name contains spaces, the command will crash. Variables must be enclosed in quotes ("$...").

Fix #433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git autoclone is broken if token is not defined

1 participant