From ab3643388f38b309bec2083c2a8b37dc1d6f3824 Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Wed, 27 Nov 2024 19:25:36 +0100 Subject: [PATCH] ci: Fix workflow status checker script to work with `merge_group` runs --- .github/workflows/scripts/check_actions_status.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/check_actions_status.py b/.github/workflows/scripts/check_actions_status.py index 82f6d6c58cba..37f83da45271 100644 --- a/.github/workflows/scripts/check_actions_status.py +++ b/.github/workflows/scripts/check_actions_status.py @@ -7,13 +7,18 @@ CHECK_INTERVAL = 30 + def get_environment_variables() -> Tuple[str, str, str, str, str]: """Retrieve and return necessary environment variables.""" try: with open(os.environ["GITHUB_EVENT_PATH"]) as f: event = json.load(f) - sha = event["pull_request"]["head"]["sha"] + # Handle both PR and merge group events + if "pull_request" in event: + sha = event["pull_request"]["head"]["sha"] + else: + sha = os.environ["GITHUB_SHA"] return ( os.environ["GITHUB_API_URL"],