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.
MIT License
169 stars 60 forks source link

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

Closed tspascoal closed 2 years ago

tspascoal commented 3 years ago

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)

srggrs commented 3 years ago

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

cpswan commented 3 years ago

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.

tspascoal commented 3 years ago

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