fix(GitHub Node): Return pagination token as string in resource locators (#29099)

Co-authored-by: RomanDavydchuk <roman.davydchuk@n8n.io>
This commit is contained in:
Bernhard Wittmann
2026-04-24 15:39:44 +00:00
committed by GitHub
co-authored by RomanDavydchuk
parent 0d16dd5dfb
commit 5dda3b2142
2 changed files with 11 additions and 8 deletions
@@ -61,7 +61,8 @@ export async function getUsers(
url: item.html_url,
}));
const nextPaginationToken = page * per_page < responseData.total_count ? page + 1 : undefined;
const nextPaginationToken =
page * per_page < responseData.total_count ? String(page + 1) : undefined;
return { results, paginationToken: nextPaginationToken };
}
@@ -97,7 +98,8 @@ export async function getRepositories(
url: item.html_url,
}));
const nextPaginationToken = page * per_page < responseData.total_count ? page + 1 : undefined;
const nextPaginationToken =
page * per_page < responseData.total_count ? String(page + 1) : undefined;
return { results, paginationToken: nextPaginationToken };
}
@@ -126,7 +128,8 @@ export async function getWorkflows(
value: workflow.id,
}));
const nextPaginationToken = page * per_page < responseData.total_count ? page + 1 : undefined;
const nextPaginationToken =
page * per_page < responseData.total_count ? String(page + 1) : undefined;
return { results, paginationToken: nextPaginationToken };
}
@@ -177,6 +180,6 @@ export async function getRefs(
);
return { results: filteredRefs };
}
const nextPaginationToken = responseData.length === per_page ? page + 1 : undefined;
const nextPaginationToken = responseData.length === per_page ? String(page + 1) : undefined;
return { results: refs, paginationToken: nextPaginationToken };
}
@@ -73,7 +73,7 @@ describe('Search Functions', () => {
{ name: 'test-user-1', value: 'test-user-1', url: 'https://github.com/test-user-1' },
{ name: 'test-user-2', value: 'test-user-2', url: 'https://github.com/test-user-2' },
],
paginationToken: 2,
paginationToken: '2',
});
});
@@ -303,7 +303,7 @@ describe('Search Functions', () => {
{ name: 'workflow-1', value: '1' },
{ name: 'workflow-2', value: '2' },
],
paginationToken: 2,
paginationToken: '2',
});
});
@@ -333,7 +333,7 @@ describe('Search Functions', () => {
{ name: 'workflow-3', value: '3' },
{ name: 'workflow-4', value: '4' },
],
paginationToken: 2,
paginationToken: '2',
});
expect(mockLoadOptionsFunctions.helpers.requestWithAuthentication).toHaveBeenCalledWith(
@@ -492,7 +492,7 @@ describe('Search Functions', () => {
const result = await getRefs.call(mockLoadOptionsFunctions);
expect(result.paginationToken).toBe(2);
expect(result.paginationToken).toBe('2');
expect(result.results.length).toBe(100);
});
});