mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
remove unneeded PAT embed check
This commit is contained in:
parent
2b46e8a9d6
commit
c40576d0a5
2 changed files with 0 additions and 14 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import { CheckRepoActions, GitConfigScope, simpleGit, SimpleGitProgressEvent } from 'simple-git';
|
||||
import { mkdir } from 'node:fs/promises';
|
||||
import { env } from './env.js';
|
||||
import { doesHaveEmbeddedToken } from './utils.js';
|
||||
|
||||
type onProgressFn = (event: SimpleGitProgressEvent) => void;
|
||||
|
||||
|
|
@ -28,10 +27,6 @@ export const cloneRepository = async (
|
|||
})
|
||||
|
||||
if (authHeader) {
|
||||
if (doesHaveEmbeddedToken(cloneUrl)) {
|
||||
throw new Error("Cannot use auth header when clone URL has embedded token");
|
||||
}
|
||||
|
||||
await git.clone(
|
||||
cloneUrl,
|
||||
path,
|
||||
|
|
@ -87,10 +82,6 @@ export const fetchRepository = async (
|
|||
})
|
||||
|
||||
if (authHeader) {
|
||||
if (doesHaveEmbeddedToken(cloneUrl)) {
|
||||
throw new Error("Cannot use auth header when clone URL has embedded token");
|
||||
}
|
||||
|
||||
await git.addConfig("http.extraHeader", authHeader);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -241,8 +241,3 @@ const createGitCloneUrlWithToken = (cloneUrl: string, credentials: { username?:
|
|||
}
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
export const doesHaveEmbeddedToken = (cloneUrl: string) => {
|
||||
const url = new URL(cloneUrl);
|
||||
return url.username || url.password;
|
||||
}
|
||||
Loading…
Reference in a new issue