fix: add error handling for missing review data in PR reviewer

This commit is contained in:
ofir-frd
2025-04-03 13:23:41 +03:00
committed by GitHub
parent 14971c4f5f
commit 9254225949

View File

@ -229,6 +229,10 @@ class PRReviewer:
first_key=first_key, last_key=last_key) first_key=first_key, last_key=last_key)
github_action_output(data, 'review') github_action_output(data, 'review')
if 'review' not in data:
get_logger().exception("Failed to parse review data", artifact={"data": data})
return ""
# move data['review'] 'key_issues_to_review' key to the end of the dictionary # move data['review'] 'key_issues_to_review' key to the end of the dictionary
if 'key_issues_to_review' in data['review']: if 'key_issues_to_review' in data['review']:
key_issues_to_review = data['review'].pop('key_issues_to_review') key_issues_to_review = data['review'].pop('key_issues_to_review')