From a0bb2adc9f5c881db865cdf7a76395826f4f8aeb Mon Sep 17 00:00:00 2001
From: Eric Timmons <etimmons@mit.edu>
Date: Tue, 3 Nov 2020 20:29:57 -0500
Subject: [PATCH] Push only on default branch

---
 .gitlab-ci.yml | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cb02b47..972c5bd 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -184,7 +184,7 @@ Bashbrew push - amd64:
     BASHBREW_ARCH: amd64
     DOCKER_PLATFORM: linux/amd64
   rules:
-    - if: $CL_DOCKER_IMAGES_AMD64
+    - if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) && $CL_DOCKER_IMAGES_AMD64
   tags:
     - bashbrew-amd64
 
@@ -195,7 +195,7 @@ Bashbrew push - arm64:
     BASHBREW_ARCH: arm64v8
     DOCKER_PLATFORM: linux/arm64
   rules:
-    - if: $CL_DOCKER_IMAGES_ARM64V8
+    - if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) && $CL_DOCKER_IMAGES_ARM64V8
   tags:
     - bashbrew-arm64v8
 
@@ -206,14 +206,14 @@ Bashbrew push - arm32v7:
     BASHBREW_ARCH: arm32v7
     DOCKER_PLATFORM: linux/arm/v7
   rules:
-    - if: $CL_DOCKER_IMAGES_ARM32V7
+    - if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) && $CL_DOCKER_IMAGES_ARM32V7
   tags:
     - bashbrew-arm32v7
 
 Bashbrew push - winamd64:
   extends: .Bashbrew push win
   rules:
-    - if: $CL_DOCKER_IMAGES_WINAMD64
+    - if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) && $CL_DOCKER_IMAGES_WINAMD64
 
 ##############################################################################
 # Put shared
@@ -232,6 +232,8 @@ Bashbrew put-shared:
     - retry -t 3 -d 60 -- bashbrew --arch-namespace amd64=${CANONICAL_NAMESPACE}amd64 --arch-namespace arm32v7=${CANONICAL_NAMESPACE}arm32v7 --arch-namespace arm64v8=${CANONICAL_NAMESPACE}arm64v8 --arch-namespace windows-amd64=${CANONICAL_NAMESPACE}winamd64 put-shared "$CI_PROJECT_NAME"
   tags:
     - bashbrew-amd64
+  rules:
+    - if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH)
   cache:
     paths:
       - cache
-- 
GitLab