Unverified Commit 5343c50a authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

workflows/labels: skip old PRs without the right artifacts

We don't need to handle the differently named artifacts in a special
way, because they have been expired anyway. But, we must handle the case
to not cause the job to fail.
parent 022bbfd6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -130,8 +130,10 @@ jobs:

                  // Instead of checking the boolean artifact.expired, we will give us a minute to
                  // actually download the artifact in the next step and avoid that race condition.
                  // Older PRs, where the workflow run was already eval.yml, but the artifact was not
                  // called "comparison", yet, will be skipped as well.
                  log('Artifact expires at', artifact?.expires_at ?? '<not found>')
                  if (new Date(artifact.expires_at) < new Date(new Date().getTime() + 60 * 1000)) return;
                  if (new Date(artifact?.expires_at ?? 0) < new Date(new Date().getTime() + 60 * 1000)) return;

                  await artifactClient.downloadArtifact(artifact.id, {
                    findBy: {