From 8610bcef9d030013f9e36cffe0c58dd2cfe85d66 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 12 Nov 2024 12:14:34 +0100 Subject: [PATCH] ci: skip Github CI on branch pushes for forks Consistent with Cirrus behavior introduced in e9bfbb5414ab14ca14d8edcfdf77f28c9ed67c33. --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32755865ee3..a63e0131c82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,8 +80,12 @@ jobs: # See: https://github.com/actions/runner-images#available-images. runs-on: macos-14 - # No need to run on the read-only mirror, unless it is a PR. - if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request' + # When a contributor maintains a fork of the repo, any pull request they make + # to their own fork, or to the main repository, will trigger two CI runs: + # one for the branch push and one for the pull request. + # This can be avoided by setting SKIP_BRANCH_PUSH=true as a custom env variable + # in Github repository settings. + if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }} timeout-minutes: 120 @@ -135,8 +139,7 @@ jobs: # See: https://github.com/actions/runner-images#available-images. runs-on: windows-2022 - # No need to run on the read-only mirror, unless it is a PR. - if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request' + if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }} env: PYTHONUTF8: 1 @@ -215,8 +218,7 @@ jobs: asan-lsan-ubsan-integer-no-depends-usdt: name: 'ASan + LSan + UBSan + integer, no depends, USDT' runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools - # No need to run on the read-only mirror, unless it is a PR. - if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request' + if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }} timeout-minutes: 120 env: FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"