Skip to content

Commit 41fc4e6

Browse files
committed
Handle retries in build reporting
1 parent a0f6f6f commit 41fc4e6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scripts/gha/report_build_status.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,13 @@ def main(argv):
482482
sorted_artifacts = sorted(artifacts, key=lambda art: dateutil.parser.parse(art['created_at']), reverse=True)
483483

484484
with tempfile.TemporaryDirectory() as tmpdir:
485+
downloaded_artifact_names = set()
485486
for a in sorted_artifacts: # Iterate over sorted artifacts
486487
if 'log-artifact' in a['name']:
488+
if a['name'] in downloaded_artifact_names:
489+
logging.debug("Skipping older attempt of artifact: %s (ID: %s, Created: %s)", a['name'], a['id'], a['created_at'])
490+
continue
491+
downloaded_artifact_names.add(a['name'])
487492
logging.debug("Attempting to download artifact: %s (ID: %s, Created: %s)", a['name'], a['id'], a['created_at'])
488493
# Pass tmpdir to download_artifact to save directly
489494
artifact_downloaded_path = os.path.join(tmpdir, f"{a['id']}.zip")

0 commit comments

Comments
 (0)