From a9f0d6b16047a93d20dab7e8ca23ad122a211d0f Mon Sep 17 00:00:00 2001 From: Cheng Date: Tue, 18 Nov 2025 15:16:25 +0900 Subject: [PATCH] Avoid duplicate CI runs when starting a PR from upstream branch (#2788) --- .github/workflows/pull_request.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e9a5c1b5..d21bd1cc 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,6 +1,12 @@ name: Build and Test -on: [pull_request, push] +on: + pull_request: + push: + branches: + - main + # For testing CI without starting a pull request: + - test/* permissions: contents: read @@ -14,10 +20,10 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v5 - - uses: ./.github/actions/setup-linux - uses: pre-commit/action@v3.0.1 linux_build_and_test: + needs: check_lint strategy: matrix: runner: @@ -75,6 +81,7 @@ jobs: linux_fedora_build_cpp: name: Linux Fedora CPP Build (${{ matrix.arch }}) + needs: check_lint strategy: fail-fast: false matrix: