From f9a83b6ad0f1fb82d1e0dab2d5fe0eb42cd6b73e Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 8 Nov 2026 11:10:23 -0800 Subject: [PATCH 1/2] ci: run the required checks in the merge queue The ruleset requires a branch to be up to date with main, and main moves several times an hour, so a pull request often fell behind during its own run and needed another. A merge queue tests each pull request merged onto the queue ahead of it instead. CI and Leaks run on merge_group events, and Container scan scans the queued tree. The CLA check, which only pull request events can run, reports as satisfied in the queue, since a pull request enters it only after its own CLA check passed. --- .github/workflows/ci.yml | 12 +++++++----- .github/workflows/cla-merge-queue.yml | 18 ++++++++++++++++++ .github/workflows/leaks.yml | 3 +++ CONTRIBUTING.md | 4 ++++ 4 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/cla-merge-queue.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 488240650..d1d7c4f12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,8 @@ on: branches: [main] pull_request: branches: [main] + # The merge queue tests each pull request merged onto the queue ahead of it. + merge_group: concurrency: group: ci-${{ github.ref }} @@ -274,12 +276,12 @@ jobs: if-no-files-found: ignore retention-days: 7 - # Build the exact runtime image on pull requests and reject high/critical OS, - # Go-binary, or embedded-secret findings before merge. It runs beside Gate - # rather than after it; both are required. + # Build the exact runtime image on pull requests and in the merge queue, and + # reject high/critical OS, Go-binary, or embedded-secret findings before + # merge. It runs beside Gate rather than after it; both are required. container-scan: name: Container scan - if: github.event_name == 'pull_request' + if: github.event_name != 'push' runs-on: ubuntu-24.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -291,7 +293,7 @@ jobs: load: true push: false tags: fanout:ci - build-args: VERSION=sha-${{ github.event.pull_request.head.sha }} + build-args: VERSION=sha-${{ github.event.pull_request.head.sha || github.sha }} cache-from: type=gha cache-to: type=gha,mode=max - name: Scan the runtime image diff --git a/.github/workflows/cla-merge-queue.yml b/.github/workflows/cla-merge-queue.yml new file mode 100644 index 000000000..df7eadb45 --- /dev/null +++ b/.github/workflows/cla-merge-queue.yml @@ -0,0 +1,18 @@ +name: CLA + +# "Check CLA" is a required check, and the CLA workflow runs only on pull +# request events, which never fire in the merge queue. A pull request enters +# the queue only after its own "Check CLA" passed, and the merged changes are +# the same commits, so the queue reports the check as satisfied. This +# workflow checks out nothing and holds no permissions. +on: + merge_group: + +permissions: {} + +jobs: + cla: + name: Check CLA + runs-on: ubuntu-24.04 + steps: + - run: echo "Signed on the pull request before it entered the queue." diff --git a/.github/workflows/leaks.yml b/.github/workflows/leaks.yml index ed0a0dc21..d30bbfde6 100644 --- a/.github/workflows/leaks.yml +++ b/.github/workflows/leaks.yml @@ -8,6 +8,9 @@ on: pull_request: branches: [main] types: [opened, edited, synchronize, reopened] + # The pull request's text was scanned before it could enter the queue; the + # queue rescans the merged files. + merge_group: permissions: contents: read diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96fab4e93..99fa3edd9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -155,6 +155,10 @@ review than one large one. If a change affects runtime behavior, public contracts, data, or security, say so explicitly in the description. +Approved pull requests merge through GitHub's merge queue, which reruns the +required checks on the pull request merged onto `main` and anything queued +ahead of it, so a branch need not be kept up to date by hand. + Keep credentials, private telemetry, local workstation paths, and private AI session links out of source files, documentation, commit messages, and pull request descriptions. Local agent caches and evaluation records belong in From a4d32ea877c6c1337df5f3e690f951b8abfb3abe Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 8 Nov 2026 11:20:13 -0800 Subject: [PATCH 2/2] ci: scan the queued commit messages for leaks In the merge queue, the pull request text step does not run, yet the queue's squash commits carry the title and description that land on main. Scan those commit messages instead. --- .github/workflows/leaks.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/leaks.yml b/.github/workflows/leaks.yml index d30bbfde6..eddf49e0c 100644 --- a/.github/workflows/leaks.yml +++ b/.github/workflows/leaks.yml @@ -8,8 +8,7 @@ on: pull_request: branches: [main] types: [opened, edited, synchronize, reopened] - # The pull request's text was scanned before it could enter the queue; the - # queue rescans the merged files. + # The queue rescans the merged files and the commit text that lands on main. merge_group: permissions: @@ -50,3 +49,14 @@ jobs: run: | { printf '%s\n%s\n' "$TITLE" "$BODY"; git log --format=%B "$BASE..$HEAD"; } | "$RUNNER_TEMP/gitleaks" stdin --redact --no-banner + + # The queue's commits carry the squash title and message, so this is the + # text main receives, even if the description changed after queueing. + - name: Scan the queued commit messages + if: github.event_name == 'merge_group' + env: + BASE: ${{ github.event.merge_group.base_sha }} + HEAD: ${{ github.event.merge_group.head_sha }} + run: | + git log --format=%B "$BASE..$HEAD" | + "$RUNNER_TEMP/gitleaks" stdin --redact --no-banner