From e611f193bdeacdcfc5cbbea1b2b0b52b14f8d070 Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Fri, 18 Sep 2026 19:03:12 -0400 Subject: [PATCH] ci: run required checks on merge_group for the merge queue (#236) governance and Build and test are the required checks on main. A merge queue only counts checks that ran on the merge_group event, so the workflow now triggers on it. The governance gate reads the merge group's own base SHA because github.event.before is empty there. --- .github/workflows/ci.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0409abf0..ef6ccb02 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,6 +3,9 @@ name: Frontend checks on: pull_request: branches: [main, dev] + # The merge queue builds main plus the queued pull requests on a temporary + # branch and only counts checks that ran on the merge_group event. + merge_group: push: branches: [main] workflow_dispatch: {} @@ -32,6 +35,7 @@ jobs: # # GOVERNANCE_BASE points the changed-file gate at the right diff: # PR -> the PR target branch (origin/) + # merge group -> the group's own base (github.event.merge_group.base_sha) # push-> the previous commit on the branch (github.event.before) # manual -> main, for exact-head recovery runs runs-on: ubuntu-latest @@ -46,10 +50,13 @@ jobs: EVENT_NAME: ${{ github.event_name }} EVENT_BEFORE: ${{ github.event.before }} PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} + MERGE_GROUP_BASE_SHA: ${{ github.event.merge_group.base_sha }} run: | set -euo pipefail if [[ "${EVENT_NAME}" == "pull_request" ]]; then base="${PR_BASE_SHA}" + elif [[ "${EVENT_NAME}" == "merge_group" && -n "${MERGE_GROUP_BASE_SHA}" ]]; then + base="${MERGE_GROUP_BASE_SHA}" elif [[ "${EVENT_NAME}" == "push" && -n "${EVENT_BEFORE}" && ! "${EVENT_BEFORE}" =~ ^0+$ ]]; then base="${EVENT_BEFORE}" else