From d739141f7d93daf97b3bf80a5b32907b84a82964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=8BFaizaan?= Date: Thu, 16 Mar 2023 11:20:08 +0530 Subject: [PATCH] fix: Add support for PAT in Bitbucket Server. Closes #14900 (#20974) --- lib/modules/platform/bitbucket-server/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/modules/platform/bitbucket-server/index.ts b/lib/modules/platform/bitbucket-server/index.ts index acdc8bd71fce18..b3e574dc7fedfe 100644 --- a/lib/modules/platform/bitbucket-server/index.ts +++ b/lib/modules/platform/bitbucket-server/index.ts @@ -81,13 +81,14 @@ export function initPlatform({ endpoint, username, password, + token, }: PlatformParams): Promise { if (!endpoint) { throw new Error('Init: You must configure a Bitbucket Server endpoint'); } - if (!(username && password)) { + if (!(username && password) && !token) { throw new Error( - 'Init: You must configure a Bitbucket Server username/password' + 'Init: You must configure either a Bitbucket Server token or username and password' ); } // TODO: Add a connection check that endpoint/username/password combination are valid (#9595)