Skip to content

Commit

Permalink
handle error
Browse files Browse the repository at this point in the history
Signed-off-by: Yutaka Kondo <[email protected]>
  • Loading branch information
youtalk committed Nov 28, 2024
1 parent 2d22b4c commit 1a295b3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ def get_workflow_duration_list(

# By calling jobs API for each workflow run
for index, run in enumerate(workflow_runs):
jobs = requests.get(run["jobs_url"], headers=self.headers).json()[
"jobs"
]
json_response = requests.get(run["jobs_url"], headers=self.headers).json()
if "jobs" not in json_response:
print(f"Error in fetching jobs from {run["jobs_url"]}: {json_response}")
continue
jobs = json_response["jobs"]

run["jobs"] = {}
run["duration"] = 0
Expand Down

0 comments on commit 1a295b3

Please sign in to comment.