Skip to content

Commit 8610bce

Browse files
committed
ci: skip Github CI on branch pushes for forks
Consistent with Cirrus behavior introduced in e9bfbb5.
1 parent 2b33322 commit 8610bce

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/ci.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,12 @@ jobs:
8080
# See: https://github.com/actions/runner-images#available-images.
8181
runs-on: macos-14
8282

83-
# No need to run on the read-only mirror, unless it is a PR.
84-
if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request'
83+
# When a contributor maintains a fork of the repo, any pull request they make
84+
# to their own fork, or to the main repository, will trigger two CI runs:
85+
# one for the branch push and one for the pull request.
86+
# This can be avoided by setting SKIP_BRANCH_PUSH=true as a custom env variable
87+
# in Github repository settings.
88+
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
8589

8690
timeout-minutes: 120
8791

@@ -135,8 +139,7 @@ jobs:
135139
# See: https://github.com/actions/runner-images#available-images.
136140
runs-on: windows-2022
137141

138-
# No need to run on the read-only mirror, unless it is a PR.
139-
if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request'
142+
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
140143

141144
env:
142145
PYTHONUTF8: 1
@@ -215,8 +218,7 @@ jobs:
215218
asan-lsan-ubsan-integer-no-depends-usdt:
216219
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
217220
runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
218-
# No need to run on the read-only mirror, unless it is a PR.
219-
if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request'
221+
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
220222
timeout-minutes: 120
221223
env:
222224
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"

0 commit comments

Comments
 (0)