fix: pass OAuth token explicitly to avoid config token overwrite

Signed-off-by: ElaineDeMattosSilvaB <elaine.de-mattos-silva-bezerra@deutschebahn.com>
This commit is contained in:
ElaineDeMattosSilvaB
2025-06-03 16:06:54 +02:00
parent 77d09fa2c2
commit 9afe2702ab
2 changed files with 5 additions and 6 deletions
+4 -2
View File
@@ -40,8 +40,9 @@ import {
export async function getGitLabFileFetchUrl(
url: string,
config: GitLabIntegrationConfig,
token?: string,
): Promise<string> {
const projectID = await getProjectId(url, config);
const projectID = await getProjectId(url, config, token);
return buildProjectUrl(url, projectID, config).toString();
}
@@ -113,6 +114,7 @@ export function buildProjectUrl(
export async function getProjectId(
target: string,
config: GitLabIntegrationConfig,
token?: string,
): Promise<number> {
const url = new URL(target);
@@ -143,7 +145,7 @@ export async function getProjectId(
const response = await fetch(
repoIDLookup.toString(),
getGitLabRequestOptions(config),
getGitLabRequestOptions(config, token),
);
const data = await response.json();