Skip to content

eBPF-based security platform

ci: Get ready to enable merge queue

Michi Mutsuzaki6514073a6b62
diff --git a/.github/scripts/ci-commit-range.sh b/.github/scripts/ci-commit-range.sh
index 690d9b4d..557f0c70 100755
--- a/.github/scripts/ci-commit-range.sh
+++ b/.github/scripts/ci-commit-range.sh
@@ -3,16 +3,16 @@
# Copyright (c) 2026 Authors of shirudo
#
# .github/scripts/ci-commit-range.sh -- run a checker over the commits a
-# GitHub event covers: every commit a pull request adds, or a push brings
-# to the branch. A push whose previous tip is unknown, after a force push,
-# is checked at the pushed tip alone.
+# GitHub event covers: every commit a pull request or merge group adds, or
+# a push brings to the branch. A push whose previous tip is unknown, after
+# a force push, is checked at the pushed tip alone.
#
# .github/scripts/ci-commit-range.sh <command> [<argument>...]
#
# The command runs with the rev-list arguments for the range appended,
# the form check-dco.sh and check-style.sh take. The event comes from the
# environment the workflow sets: EVENT_NAME, and BASE_SHA and HEAD_SHA for
-# a pull request, BEFORE_SHA and SHA for a push.
+# a pull request or merge group, BEFORE_SHA and SHA for a push.
set -eu
@@ -21,7 +21,8 @@ set -eu
exit 2
}
-if [ "${EVENT_NAME:-}" = pull_request ]; then
+if [ "${EVENT_NAME:-}" = pull_request ] ||
+ [ "${EVENT_NAME:-}" = merge_group ]; then
set -- "$@" "${BASE_SHA:?}..${HEAD_SHA:?}"
elif git cat-file -e "${BEFORE_SHA:-}^{commit}" 2>/dev/null; then
set -- "$@" "$BEFORE_SHA..${SHA:?}"
diff --git a/.github/workflows/build-commits.yml b/.github/workflows/build-commits.yml
index 6a386049..4142ba4c 100644
--- a/.github/workflows/build-commits.yml
+++ b/.github/workflows/build-commits.yml
@@ -5,6 +5,8 @@ on:
branches:
- main
pull_request:
+ merge_group:
+ types: [checks_requested]
permissions:
contents: read
@@ -52,4 +54,4 @@ jobs:
.github/scripts/vm-toolchain.sh
. build/vm-toolchain.env
GITHUB_ACTIONS=true .github/scripts/build-commits.sh \
- ${{ github.event_name == 'pull_request' && format('{0}..{1}', github.event.pull_request.base.sha, github.event.pull_request.head.sha) || format('{0}..{1}', github.event.before, github.sha) }}
+ ${{ (github.event.pull_request.base.sha || github.event.merge_group.base_sha) && format('{0}..{1}', github.event.pull_request.base.sha || github.event.merge_group.base_sha, github.event.pull_request.head.sha || github.event.merge_group.head_sha) || format('{0}..{1}', github.event.before, github.sha) }}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2feec04e..829c485f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -5,6 +5,8 @@ on:
branches:
- main
pull_request:
+ merge_group:
+ types: [checks_requested]
permissions:
contents: read
diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml
index 65ae3f12..f5903724 100644
--- a/.github/workflows/dco.yml
+++ b/.github/workflows/dco.yml
@@ -5,6 +5,8 @@ on:
branches:
- main
pull_request:
+ merge_group:
+ types: [checks_requested]
permissions:
contents: read
@@ -35,8 +37,8 @@ jobs:
- name: Check the sign-off of every commit
env:
EVENT_NAME: ${{ github.event_name }}
- BASE_SHA: ${{ github.event.pull_request.base.sha }}
- HEAD_SHA: ${{ github.event.pull_request.head.sha }}
+ BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
+ HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
BEFORE_SHA: ${{ github.event.before }}
SHA: ${{ github.sha }}
run: .github/scripts/ci-commit-range.sh .github/scripts/check-dco.sh
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 7ba8a123..d877eb4e 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -7,6 +7,8 @@ on:
tags:
- '*'
pull_request:
+ merge_group:
+ types: [checks_requested]
workflow_dispatch:
permissions:
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index a211fb60..b6b6135d 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -5,6 +5,8 @@ on:
branches:
- main
pull_request:
+ merge_group:
+ types: [checks_requested]
permissions:
contents: read
@@ -115,8 +117,8 @@ jobs:
- name: Run checkpatch over every commit
env:
EVENT_NAME: ${{ github.event_name }}
- BASE_SHA: ${{ github.event.pull_request.base.sha }}
- HEAD_SHA: ${{ github.event.pull_request.head.sha }}
+ BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
+ HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
BEFORE_SHA: ${{ github.event.before }}
SHA: ${{ github.sha }}
run: .github/scripts/ci-commit-range.sh .github/scripts/check-style.sh
diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml
index 0e4c83d1..078b0d12 100644
--- a/.github/workflows/packages.yml
+++ b/.github/workflows/packages.yml
@@ -8,6 +8,8 @@ on:
- '*'
- '!test-kernel-*'
pull_request:
+ merge_group:
+ types: [checks_requested]
workflow_dispatch:
inputs:
additional_config_cert:
@@ -325,7 +327,7 @@ jobs:
if-no-files-found: error
kernel-obs-preview:
- if: github.event_name == 'pull_request'
+ if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
needs: [deb, rpm-target]
runs-on: ubuntu-latest
timeout-minutes: 30
@@ -339,8 +341,8 @@ jobs:
uses: ./.github/actions/kernel-obs
with:
mode: preview
- version: 0.1.${{ github.run_number }}-pr.${{ github.event.pull_request.number }}
- artifact-name: kernel-obs-preview-pr-${{ github.event.pull_request.number }}
+ version: 0.1.${{ github.run_number }}-${{ github.event_name == 'pull_request' && format('pr.{0}', github.event.pull_request.number) || 'merge-group' }}
+ artifact-name: ${{ github.event_name == 'pull_request' && format('kernel-obs-preview-pr-{0}', github.event.pull_request.number) || format('kernel-obs-preview-merge-group-{0}', github.event.merge_group.head_sha) }}
kernel-obs-publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 5e383ec3..3a1b1950 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -5,6 +5,8 @@ on:
branches:
- main
pull_request:
+ merge_group:
+ types: [checks_requested]
workflow_dispatch:
inputs:
kernel_run_id:
@@ -41,7 +43,7 @@ jobs:
- name: Check whether the kernel inputs changed
id: select
env:
- BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
+ BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || github.event.before }}
KERNEL_RUN_ID: ${{ inputs.kernel_run_id }}
run: sh .github/scripts/select-test-kernel.sh