Skip to content

Commit e9bfbb5

Browse files
committed
ci: forks can opt-out of CI branch push (Cirrus only)
1 parent 323b0ac commit e9bfbb5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.cirrus.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ env: # Global defaults
2727
# The above machine types are matched to each task by their label. Refer to the
2828
# Cirrus CI docs for more details.
2929
#
30+
# When a contributor maintains a fork of the repo, any pull request they make
31+
# to their own fork, or to the main repository, will trigger two CI runs:
32+
# one for the branch push and one for the pull request.
33+
# This can be avoided by setting SKIP_BRANCH_PUSH=true as a custom env variable
34+
# in Cirrus repository settings, accessible from
35+
# https://cirrus-ci.com/github/my-organization/my-repository
36+
#
3037
# On machines that are persisted between CI jobs, RESTART_CI_DOCKER_BEFORE_RUN=1
3138
# ensures that previous containers and artifacts are cleared before each run.
3239
# This requires installing Podman instead of Docker.
@@ -59,7 +66,10 @@ env: # Global defaults
5966

6067
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
6168
filter_template: &FILTER_TEMPLATE
62-
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
69+
# Allow forks to specify SKIP_BRANCH_PUSH=true and skip CI runs when a branch is pushed,
70+
# but still run CI when a PR is created.
71+
# https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
72+
skip: $SKIP_BRANCH_PUSH == "true" && $CIRRUS_PR == ""
6373
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
6474

6575
base_template: &BASE_TEMPLATE

0 commit comments

Comments
 (0)