Add Pagination Support for Runs with >30 Artifacts#90
Conversation
|
Could you please make use of: for await (const artifacts of client.paginate.iterator(...You can see it earlier in this file as an example. |
Ah - I didn't know Octokit came with a built-in paginator! The default |
| console.log("==> RunID:", runID) | ||
|
|
||
| let artifacts = await client.actions.listWorkflowRunArtifacts({ | ||
| let artifacts = await client.paginate(client.actions.listWorkflowRunArtifacts, { |
There was a problem hiding this comment.
You need to do this in a loop. See how it is done above.
There was a problem hiding this comment.
@dawidd6 We could do it in a loop, but it would just be the same as what's going on with the default paginate. The above loop is different since we bail out early once the correct run has been found (vs here, where we would never bail since we always want all artifacts).
There was a problem hiding this comment.
Ok, just read the docs. Didn't know about it.
* Add pagination when listing all artifacts (dawidd6#90) Co-authored-by: Nick DeGroot <1966472+nickthegroot@users.noreply.github.com> * main: remove ';' * README: fix * main: throw if no runID * action: only success * README: update * workflows: test empty conclusion * Fix octokit returning weird results from listWorkflowRuns (dawidd6#95) Closes: dawidd6#93 Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com> * README: remove stray dot * download aritfact from latest run which upload an artifact (dawidd6#88) Co-authored-by: Nick DeGroot <nbdegroot1@gmail.com> Co-authored-by: Nick DeGroot <1966472+nickthegroot@users.noreply.github.com> Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com> Co-authored-by: Dirk <dirks@seatfrog.com> Co-authored-by: Tailong <54169577+shitlsh@users.noreply.github.com>
Co-authored-by: Nick DeGroot <1966472+nickthegroot@users.noreply.github.com>
Currently, runs with over 30 artifacts only download the first 30 published. This PR adds support to page through all artifacts and download them accordingly.