Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider pagination when cancelling builds #9

Open
mrcasals opened this issue Apr 29, 2020 · 3 comments
Open

Consider pagination when cancelling builds #9

mrcasals opened this issue Apr 29, 2020 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@mrcasals
Copy link

Hi!

The current code works well, but it only considers the first page of the list of job runs. We had a problem that scheduled a lot of long-running jobs (~50pages of builds, 25 jobs/page), and some have been automatically cancelled, but since this only considers the first page of the result not all jobs are cancelled.

This could be improved by changing the endpoint to this:

https://api.github.com/repos/{{REPO}}/actions/workflows/{{WORKFLOW_ID}}/runs?page={{page}}

And iterate page from 1 to a given number (maybe 5 by default, configurable?)

@rokroskar
Copy link
Owner

Thanks @mrcasals that's a really good suggestion - have you tried this? I would love to get a PR for the change! 😄

@mrcasals
Copy link
Author

mrcasals commented Apr 29, 2020

I haven't tried it yet! I'll try to come up with something, I might find time to do it!

@rokroskar
Copy link
Owner

Perfect, thanks.

@rokroskar rokroskar added enhancement New feature or request help wanted Extra attention is needed labels Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants