diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48824065..d1d7c4f1 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 00000000..df7eadb4 --- /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 ed0a0dc2..eddf49e0 100644 --- a/.github/workflows/leaks.yml +++ b/.github/workflows/leaks.yml @@ -8,6 +8,8 @@ on: pull_request: branches: [main] types: [opened, edited, synchronize, reopened] + # The queue rescans the merged files and the commit text that lands on main. + merge_group: permissions: contents: read @@ -47,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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96fab4e9..99fa3edd 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