From 82da911c27b8978baf87b535d3f014730183293f Mon Sep 17 00:00:00 2001 From: Thilo Fromm Date: Thu, 24 Feb 2022 11:02:34 +0100 Subject: [PATCH] ci-automation/sdk_bootstrap: Only push to main in nightlies Signed-off-by: Thilo Fromm --- ci-automation/sdk_bootstrap.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ci-automation/sdk_bootstrap.sh b/ci-automation/sdk_bootstrap.sh index d7b14effad..c0758e3e3c 100644 --- a/ci-automation/sdk_bootstrap.sh +++ b/ci-automation/sdk_bootstrap.sh @@ -85,10 +85,11 @@ function sdk_bootstrap() { cd - # Create new tag in scripts repo w/ updated versionfile + submodules. - # When on the 'main' branch then also push to the branch so the versionfile - # and git submodules stay up to date. + # Also push the changes to the branch ONLY IF we're doing a nightly + # build of the 'main' branch AND we're definitely ON the main branch. local push_branch="false" - if [ "$(git rev-parse --abbrev-ref HEAD)" = "main" ] ; then + if [[ "${version}" =~ ^main-[0-9.]+-nightly-[-0-9]+$ ]] \ + && [ "$(git rev-parse --abbrev-ref HEAD)" = "main" ] ; then push_branch="true" fi update_and_push_version "sdk-${git_vernum}" "${push_branch}"