diff --git a/packages/integration/api-report.md b/packages/integration/api-report.md index a1a14689ca..8939d24b20 100644 --- a/packages/integration/api-report.md +++ b/packages/integration/api-report.md @@ -501,7 +501,7 @@ export type GitlabCredentials = { // @public (undocumented) export interface GitlabCredentialsProvider { // (undocumented) - getCredentials(opts?: { url: string }): Promise; + getCredentials(opts: { url: string }): Promise; } // @public diff --git a/packages/integration/src/gitlab/SingleInstanceGitlabCredentialsProvider.ts b/packages/integration/src/gitlab/SingleInstanceGitlabCredentialsProvider.ts index 39f22ab9d5..76068a948e 100644 --- a/packages/integration/src/gitlab/SingleInstanceGitlabCredentialsProvider.ts +++ b/packages/integration/src/gitlab/SingleInstanceGitlabCredentialsProvider.ts @@ -28,11 +28,15 @@ export class SingleInstanceGitlabCredentialsProvider constructor(private readonly token?: string) {} - async getCredentials(): Promise { + async getCredentials(_opts: { url: string }): Promise { + if (!this.token) { + return {}; + } + return { - headers: this.token - ? { Authorization: `Bearer ${this.token}` } - : undefined, + headers: { + Authorization: `Bearer ${this.token}`, + }, token: this.token, }; } diff --git a/packages/integration/src/gitlab/types.ts b/packages/integration/src/gitlab/types.ts index ef8ccf8d6c..b980aaba7b 100644 --- a/packages/integration/src/gitlab/types.ts +++ b/packages/integration/src/gitlab/types.ts @@ -26,5 +26,5 @@ export type GitlabCredentials = { * @public */ export interface GitlabCredentialsProvider { - getCredentials(opts?: { url: string }): Promise; + getCredentials(opts: { url: string }): Promise; }