kanga333 / comment-hider

Github Action to hide comments made by Github Action
MIT License
8 stars 7 forks source link

Iterate over all comments #81

Open eseiler opened 1 year ago

eseiler commented 1 year ago

Thank you for this action!

Currently, only the first 30 comments can be hidden. When the comments are queried here https://github.com/kanga333/comment-hider/blob/c12bb20b48aeb8fc098e35967de8d4f8018fffdf/src/client.ts#L38 the default of 30 is used (see docs).

To get all comments, we would have to get the comments repeatedly, i.e. per_page=100 and then query consecutive pages until we are done.

kanga333 commented 1 year ago

Thanks for the report. I'll try to implement it when I have some time. Of course, pull requests are always welcome 👍

barracudarin commented 1 year ago

@kanga333 i've put up a pull request that should add pagination. i don't have a full Typescript env set up on my machine, so I wasn't able to verify the tests work.

But they should be (hopefully) most of the way there.

edit: i set up my environment and fixed up everything. the tests pass locally and the action works