From 348a983d75c3f067892dfe34de3b86ad0be0e31c Mon Sep 17 00:00:00 2001 From: Sten Raudmets Date: Tue, 23 Jan 2024 12:15:11 +0200 Subject: [PATCH] Ignore expired artifacts --- dist/index.js | 2 +- src/download-artifacts.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index f8ab185..fb0a20b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -127957,7 +127957,7 @@ async function findArtifactForBranch({ octokit, branch, artifactName, }) { _e = false; const { data: artifacts } = _c; for (const artifact of artifacts) { - if (((_d = artifact.workflow_run) === null || _d === void 0 ? void 0 : _d.head_branch) === branch) { + if (((_d = artifact.workflow_run) === null || _d === void 0 ? void 0 : _d.head_branch) === branch && !artifact.expired) { return artifact; } } diff --git a/src/download-artifacts.ts b/src/download-artifacts.ts index cbba38d..24b54b9 100644 --- a/src/download-artifacts.ts +++ b/src/download-artifacts.ts @@ -27,7 +27,7 @@ async function findArtifactForBranch({ let pageIndex = 0; for await (const { data: artifacts } of artifactPageIterator) { for (const artifact of artifacts) { - if (artifact.workflow_run?.head_branch === branch) { + if (artifact.workflow_run?.head_branch === branch && !artifact.expired) { return artifact; } }