Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

ci: Fix workflow status checker script to work with `merge_group` runs

Reinier van der Leerab3643388f38
diff --git a/.github/workflows/scripts/check_actions_status.py b/.github/workflows/scripts/check_actions_status.py
index 82f6d6c58c..37f83da452 100644
--- a/.github/workflows/scripts/check_actions_status.py
+++ b/.github/workflows/scripts/check_actions_status.py
@@ -7,13 +7,18 @@ from typing import Dict, List, Tuple
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"],