diff --git a/.github/scripts/python/view-pull-request/__main__.py b/.github/scripts/python/view-pull-request/__main__.py index 3159a24b..c8669111 100644 --- a/.github/scripts/python/view-pull-request/__main__.py +++ b/.github/scripts/python/view-pull-request/__main__.py @@ -78,7 +78,8 @@ def validate_reviews(pull_request: PullRequest, state: t.Optional[str] = None): reviews.sort(key=lambda review: review["submittedAt"]) if state is not None: - assert len(reviews) >= 1 and reviews[-1]["state"] == state, ( + assert reviews, "The pull request has not been reviewed." + assert reviews[-1]["state"] == state, ( "The latest review is not in the expected state." f' Latest: "{reviews[-1]["state"]}". Expected: "{state}".' )