remove unneeded PAT embed check

This commit is contained in:
msukkari 2025-09-27 15:57:27 -07:00
parent 2b46e8a9d6
commit c40576d0a5
2 changed files with 0 additions and 14 deletions

View file

@ -1,7 +1,6 @@
import { CheckRepoActions, GitConfigScope, simpleGit, SimpleGitProgressEvent } from 'simple-git'; import { CheckRepoActions, GitConfigScope, simpleGit, SimpleGitProgressEvent } from 'simple-git';
import { mkdir } from 'node:fs/promises'; import { mkdir } from 'node:fs/promises';
import { env } from './env.js'; import { env } from './env.js';
import { doesHaveEmbeddedToken } from './utils.js';
type onProgressFn = (event: SimpleGitProgressEvent) => void; type onProgressFn = (event: SimpleGitProgressEvent) => void;
@ -28,10 +27,6 @@ export const cloneRepository = async (
}) })
if (authHeader) { if (authHeader) {
if (doesHaveEmbeddedToken(cloneUrl)) {
throw new Error("Cannot use auth header when clone URL has embedded token");
}
await git.clone( await git.clone(
cloneUrl, cloneUrl,
path, path,
@ -87,10 +82,6 @@ export const fetchRepository = async (
}) })
if (authHeader) { if (authHeader) {
if (doesHaveEmbeddedToken(cloneUrl)) {
throw new Error("Cannot use auth header when clone URL has embedded token");
}
await git.addConfig("http.extraHeader", authHeader); await git.addConfig("http.extraHeader", authHeader);
} }

View file

@ -241,8 +241,3 @@ const createGitCloneUrlWithToken = (cloneUrl: string, credentials: { username?:
} }
return url.toString(); return url.toString();
} }
export const doesHaveEmbeddedToken = (cloneUrl: string) => {
const url = new URL(cloneUrl);
return url.username || url.password;
}