fix(GitHub Node): Fix issue with user loading not completing (#17122)

This commit is contained in:
Dana
2025-07-09 15:05:23 +02:00
committed by GitHub
parent f58e3a1e4c
commit 336d6707e3
2 changed files with 21 additions and 9 deletions

View File

@@ -37,13 +37,23 @@ export async function getUsers(
): Promise<INodeListSearchResult> {
const page = paginationToken ? +paginationToken : 1;
const per_page = 100;
const responseData: UserSearchResponse = await githubApiRequest.call(
this,
'GET',
'/search/users',
{},
{ q: filter, page, per_page },
);
let responseData: UserSearchResponse = {
items: [],
total_count: 0,
};
try {
responseData = await githubApiRequest.call(
this,
'GET',
'/search/users',
{},
{ q: filter, page, per_page },
);
} catch {
// will fail if the owner does not have any users
}
const results: INodeListSearchItems[] = responseData.items.map((item: UserSearchItem) => ({
name: item.login,