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

@@ -507,7 +507,7 @@ export class Github implements INodeType {
typeOptions: { typeOptions: {
searchListMethod: 'getUsers', searchListMethod: 'getUsers',
searchable: true, searchable: true,
searchFilterRequired: true, searchFilterRequired: false,
}, },
}, },
{ {
@@ -1705,7 +1705,9 @@ export class Github implements INodeType {
maxValue: 100, maxValue: 100,
}, },
default: 50, default: 50,
description: 'Max number of results to return', // eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-limit
description:
'Max number of results to return. Maximum value is <a href="https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests">100</a>.',
}, },
{ {
displayName: 'Filters', displayName: 'Filters',

View File

@@ -37,13 +37,23 @@ export async function getUsers(
): Promise<INodeListSearchResult> { ): Promise<INodeListSearchResult> {
const page = paginationToken ? +paginationToken : 1; const page = paginationToken ? +paginationToken : 1;
const per_page = 100; const per_page = 100;
const responseData: UserSearchResponse = await githubApiRequest.call(
this, let responseData: UserSearchResponse = {
'GET', items: [],
'/search/users', total_count: 0,
{}, };
{ q: filter, page, per_page },
); 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) => ({ const results: INodeListSearchItems[] = responseData.items.map((item: UserSearchItem) => ({
name: item.login, name: item.login,