Skip to content

Commit 2257c6d

Browse files
committed
Merge bitcoin/bitcoin#30487: ci: skip Github CI on branch pushes for forks
8610bce ci: skip Github CI on branch pushes for forks (Sjors Provoost) Pull request description: 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. After this PR when `SKIP_BRANCH_PUSH` is set, pushes made to git branches inside fork repositories will no longer trigger CI runs, unless the git branches are associated with PRs in the fork repository, or the main repository. The same behaviour was added for Cirrus in e9bfbb5. Note to maintainers: `SKIP_BRANCH_PUSH=true` needs to be set for the GUI repo to maintain existing behaviour. ACKs for top commit: m3dwards: ACK 8610bce achow101: ACK 8610bce vasild: ACK 8610bce Tree-SHA512: 4055153f03f0cb60a97ce26157ab9db40a4609dee9f060ed7b06aa8841df5bd8e1a42ff2ac0f20bd69e221e8e67bff062a9a361a291124070a03dd51c609e845
2 parents 380e1f4 + 8610bce commit 2257c6d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
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)