Skip to content

Commit

Permalink
ci: Fix workflow status checker script to work with merge_group runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Nov 27, 2024
1 parent 845c8c5 commit ab36433
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/scripts/check_actions_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit ab36433

Please sign in to comment.