Skip to content

The open alternative to Salesforce, designed for AI.

Add a required status check to the merge-queue workflow (#28514)

Paul Rastoin71ab6686a665
diff --git a/.github/workflows/ci-merge-queue.yaml b/.github/workflows/ci-merge-queue.yaml
index 9620710a40d..025f983ee87 100644
--- a/.github/workflows/ci-merge-queue.yaml
+++ b/.github/workflows/ci-merge-queue.yaml
@@ -8,6 +8,9 @@ name: CI - Merge Queue
# passed on a stale base.
on:
+ # Only so ci-merge-queue-status-check reports on PRs: a required check that
+ # never reports there keeps PRs out of the queue.
+ pull_request:
merge_group:
permissions:
@@ -17,12 +20,11 @@ permissions:
jobs:
# merge_group carries no PR labels, so resolve them from the queued PR (its
# number is in the merge-queue ref) and pass the version-mutation bypasses to
- # the guard as inputs, which relax only the version-directory step. The job
- # always runs and reports a real success/failure, so the required check never
- # resolves to a skipped state and a label-lookup failure fails closed. The
- # timestamp / append-only check has no bypass and always runs: violating it
- # rewinds the upgrade cursor.
+ # the guard as inputs, which relax only the version-directory step. A
+ # label-lookup failure fails closed. The timestamp / append-only check has no
+ # bypass and always runs: violating it rewinds the upgrade cursor.
upgrade-mutation-guard:
+ if: github.event_name == 'merge_group'
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
@@ -65,3 +67,13 @@ jobs:
base_sha: ${{ github.event.merge_group.base_sha }}
allow_previous_version_mutation: ${{ steps.labels.outputs.allow_previous }}
allow_next_version_mutation: ${{ steps.labels.outputs.allow_next }}
+
+ ci-merge-queue-status-check:
+ if: always() && !cancelled()
+ timeout-minutes: 5
+ runs-on: ubuntu-latest
+ needs: [upgrade-mutation-guard]
+ steps:
+ - name: Fail job if any needs failed
+ if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
+ run: exit 1