Skip to content

Commit

Permalink
contest: gh: protect from empty workflow_runs
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Jul 24, 2024
1 parent 9ba9d09 commit 6112db7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contest/remote/gh.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_results(config, cbarg, prev_run, page=1):
resp = get(repo_url + f'/actions/runs?page={page}', token)
runs = resp.json()
found = None
for run in runs.get('workflow_runs'):
for run in runs.get('workflow_runs', []):
if ref in [r['ref'] for r in run['referenced_workflows']]:
if found is None or found["id"] < run["id"]:
found = run
Expand Down

0 comments on commit 6112db7

Please sign in to comment.