srggrs / assign-one-project-github-action

Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Action fails to find project when there are more than 30 projects

tspascoal opened this issue · comments

The action can't find the project if there are more than 30 projects, since the API being used to list all projects is paginated and returns at most 30 projects (by default).

If this API is going to be used, then it will need to be paginated.

It would be easier (and faster) to ask for the project id instead of trying to determine it from the URL (a little more work for user but I think a decent tradeoff)

commented

Hi thank you for reporting this! I will look into that next month as I can find some time for it.

It would be easier (and faster) to ask for the project id instead of trying to determine it from the URL (a little more work for user but I think a decent tradeoff)

What do you mean? use the Project name instead of the URL? I decided to keep the URL, as that let the user change the name of the project without impacting the action. Or are you referring to another API? Thanks!

I welcome suggestions and PRs to improve the usability of this action

GitHub have recently started showing the defaults in the API docs, so it's more obvious that the 30 limit is there. A quick fix before getting into pagination is to bump per_page up to 100.

GitHub have recently started showing the defaults in the API docs, so it's more obvious that the 30 limit is there. A quick fix before getting into pagination is to bump per_page up to 100.

That is a stop gag measure that doesn't get you very far for mid sized orgs.

I've submitted PR #69 that implements pagination