Skip to content

Commit 011792e

Browse files
committed
fix(api): update Bitbucket API URL construction to use a unified username variable
1 parent a527baf commit 011792e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/dokploy/pages/api/deploy/[refreshToken].ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,14 @@ export const extractCommitedPaths = async (
368368
.map((change: any) => change.new?.target?.hash)
369369
.filter(Boolean);
370370
const commitedPaths: string[] = [];
371+
const username =
372+
bitbucket?.bitbucketWorkspaceName || bitbucket?.bitbucketUsername || "";
371373
for (const commit of commitHashes) {
372-
const url = `https://api.bitbucket.org/2.0/repositories/${bitbucket?.bitbucketUsername}/${repository}/diffstat/${commit}`;
373-
374+
const url = `https://api.bitbucket.org/2.0/repositories/${username}/${repository}/diffstat/${commit}`;
374375
try {
375376
const response = await fetch(url, {
376377
headers: getBitbucketHeaders(bitbucket!),
377378
});
378-
379379
const data = await response.json();
380380
for (const value of data.values) {
381381
if (value?.new?.path) commitedPaths.push(value.new.path);

0 commit comments

Comments
 (0)