diff --git a/.changeset/famous-items-travel.md b/.changeset/famous-items-travel.md new file mode 100644 index 0000000000..a0aa02732d --- /dev/null +++ b/.changeset/famous-items-travel.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-backend': patch +--- + +Update URL auth format for Gitlab clone diff --git a/plugins/techdocs-backend/src/helpers.ts b/plugins/techdocs-backend/src/helpers.ts index 901aea533a..fcf5a4f194 100644 --- a/plugins/techdocs-backend/src/helpers.ts +++ b/plugins/techdocs-backend/src/helpers.ts @@ -146,8 +146,18 @@ export const checkoutGitRepository = async ( if (token) { const type = getGitRepoType(repoUrl); - const auth = type === 'github' ? `${token}:x-oauth-basic` : `:${token}`; - parsedGitLocation.token = auth; + switch (type) { + case 'gitlab': + // Personal Access Token + parsedGitLocation.token = `dummyUsername:${token}`; + parsedGitLocation.git_suffix = true; + break; + case 'github': + parsedGitLocation.token = `${token}:x-oauth-basic`; + break; + default: + parsedGitLocation.token = `:${token}`; + } } const repositoryCheckoutUrl = parsedGitLocation.toString('https');