From 4a0e9cdce6b1163c8622459934f0738e3fd4c213 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Sat, 6 Jan 2024 12:02:51 +0000 Subject: [PATCH] fix script --- .github/scripts/python/view-pull-request/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/python/view-pull-request/__main__.py b/.github/scripts/python/view-pull-request/__main__.py index 8011e104..3159a24b 100644 --- a/.github/scripts/python/view-pull-request/__main__.py +++ b/.github/scripts/python/view-pull-request/__main__.py @@ -78,7 +78,7 @@ def validate_reviews(pull_request: PullRequest, state: t.Optional[str] = None): reviews.sort(key=lambda review: review["submittedAt"]) if state is not None: - assert reviews and reviews[-1]["state"] == state, ( + assert len(reviews) >= 1 and reviews[-1]["state"] == state, ( "The latest review is not in the expected state." f' Latest: "{reviews[-1]["state"]}". Expected: "{state}".' )