mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix(dokploy): extract all the repositories bitbucket #619
This commit is contained in:
@@ -227,9 +227,15 @@ export const getBitbucketRepositories = async (bitbucketId?: string) => {
|
||||
const username =
|
||||
bitbucketProvider.bitbucketWorkspaceName ||
|
||||
bitbucketProvider.bitbucketUsername;
|
||||
const url = `https://api.bitbucket.org/2.0/repositories/${username}?pagelen=100`;
|
||||
let url = `https://api.bitbucket.org/2.0/repositories/${username}?pagelen=100`;
|
||||
let repositories: {
|
||||
name: string;
|
||||
url: string;
|
||||
owner: { username: string };
|
||||
}[] = [];
|
||||
|
||||
try {
|
||||
while (url) {
|
||||
const response = await fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -246,23 +252,17 @@ export const getBitbucketRepositories = async (bitbucketId?: string) => {
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
const mappedData = data.values.map((repo: any) => {
|
||||
return {
|
||||
const mappedData = data.values.map((repo: any) => ({
|
||||
name: repo.name,
|
||||
url: repo.links.html.href,
|
||||
owner: {
|
||||
username: repo.workspace.slug,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
return mappedData as {
|
||||
name: string;
|
||||
url: string;
|
||||
owner: {
|
||||
username: string;
|
||||
};
|
||||
}[];
|
||||
}));
|
||||
repositories = repositories.concat(mappedData);
|
||||
url = data.next || null;
|
||||
}
|
||||
return repositories;
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user