Load all artifacts in a run

Fixes #166
This commit is contained in:
Jozef Izso 2025-12-05 00:01:38 +01:00
parent ee446707ff
commit a79abde936
Failed to extract signature
2 changed files with 6 additions and 6 deletions

6
dist/index.js generated vendored
View file

@ -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 {};

View file

@ -50,17 +50,17 @@ export class ArtifactProvider implements InputProvider {
async load(): Promise<ReportInput> {
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 {}