Skip to content

Commit 20e491d

Browse files
committed
CI/Cirrus: Skip merge_base step for non-PRs
CIRRUS_BASE_BRANCH is a PR-specific variable and undocumented on non-PR builds. In practice (at the moment), it seems to be HEAD, which in private repositories can be pretty much anything, causing CI to fail if it can't be cleanly merged. By checking CIRRUS_PR first, we can reliably do CI builds of branches outside PRs.
1 parent 543693b commit 20e491d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

.cirrus.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
2929
depends_releases_cache:
3030
folder: "/tmp/cirrus-ci-build/releases"
3131
merge_base_script:
32+
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
3233
- bash -c "$PACKAGE_MANAGER_INSTALL git"
3334
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
3435
- git config --global user.email "[email protected]"

0 commit comments

Comments
 (0)