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