Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#30487: ci: skip Github CI on branch pushes for …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
achow101 committed Nov 14, 2024
2 parents 380e1f4 + 8610bce commit 2257c6d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 2257c6d

Please sign in to comment.