From 6e06c1d1ab9d4c2082394aa4072a6fb9a2330c32 Mon Sep 17 00:00:00 2001 From: Robert Schuh Date: Sat, 3 Sep 2022 02:24:40 +0200 Subject: [PATCH] Use username password or token for bitbucket server The bitbucket server publish action allows setting the token like other platforms, if the integration has a username and password configured though, not the token but the credentials are used In config.ts the docs claim token takes precedence which only holds true if username & password are not set Signed-off-by: Robert Schuh --- packages/integration/src/bitbucketServer/core.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/integration/src/bitbucketServer/core.ts b/packages/integration/src/bitbucketServer/core.ts index 5fca2aba68..8741b8f0e7 100644 --- a/packages/integration/src/bitbucketServer/core.ts +++ b/packages/integration/src/bitbucketServer/core.ts @@ -139,8 +139,7 @@ export function getBitbucketServerRequestOptions( if (config.token) { headers.Authorization = `Bearer ${config.token}`; - } - if (config.username && config.password) { + } else if (config.username && config.password) { const buffer = Buffer.from(`${config.username}:${config.password}`, 'utf8'); headers.Authorization = `Basic ${buffer.toString('base64')}`; }