diff --git a/dist/index.js b/dist/index.js index 42cb52e..cd325b2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -94,15 +94,15 @@ class ArtifactProvider { } async load() { const result = {}; - const resp = await this.octokit.rest.actions.listWorkflowRunArtifacts({ + const allArtifacts = await this.octokit.paginate(this.octokit.rest.actions.listWorkflowRunArtifacts, { ...github.context.repo, run_id: this.runId }); - if (resp.data.artifacts.length === 0) { + if (allArtifacts.length === 0) { core.warning(`No artifacts found in run ${this.runId}`); return {}; } - const artifacts = resp.data.artifacts.filter(a => this.artifactNameMatch(a.name)); + const artifacts = allArtifacts.filter(a => this.artifactNameMatch(a.name)); if (artifacts.length === 0) { core.warning(`No artifact matches ${this.artifact}`); return {}; diff --git a/src/input-providers/artifact-provider.ts b/src/input-providers/artifact-provider.ts index 740eb93..feeb22a 100644 --- a/src/input-providers/artifact-provider.ts +++ b/src/input-providers/artifact-provider.ts @@ -50,17 +50,17 @@ export class ArtifactProvider implements InputProvider { async load(): Promise { const result: ReportInput = {} - const resp = await this.octokit.rest.actions.listWorkflowRunArtifacts({ + const allArtifacts = await this.octokit.paginate(this.octokit.rest.actions.listWorkflowRunArtifacts, { ...github.context.repo, run_id: this.runId }) - if (resp.data.artifacts.length === 0) { + if (allArtifacts.length === 0) { core.warning(`No artifacts found in run ${this.runId}`) return {} } - const artifacts = resp.data.artifacts.filter(a => this.artifactNameMatch(a.name)) + const artifacts = allArtifacts.filter(a => this.artifactNameMatch(a.name)) if (artifacts.length === 0) { core.warning(`No artifact matches ${this.artifact}`) return {}