diff --git a/create-release-branches.bash b/create-release-branches.bash index ec0cfca5..ab5af2f5 100755 --- a/create-release-branches.bash +++ b/create-release-branches.bash @@ -7,13 +7,18 @@ set -e # exit on non-zero status # When PUSH_OPTIONS=true, it also recreates all existing release branches from master branch PUSH_OPTIONS="" -if [ $FORCE_PUSH = "true" ] ;then +if [ "$FORCE_PUSH" == "true" ] ;then PUSH_OPTIONS="$PUSH_OPTIONS --force" fi current_version=$(yq -r '.directories[0].contents[] | select (.path=="k3s-io/k3s") | .githubRelease.tag ' ./vendir.yml) current_version=${current_version#v} MIN_VERSION=$(echo "$current_version"|cut -d'.' -f1-2) -for ref in $(git ls-remote -h https://github.com/k3s-io/k3s "release-*" | sed 's/refs\/heads\///' | awk '{print $2}') ; do + +function listK3sRepoBranches() { + git ls-remote -h https://github.com/k3s-io/k3s "release-*" | sed 's/refs\/heads\///' | awk '{print $2}' +} + +for ref in $(listK3sRepoBranches) ; do v=${ref#release-} BRANCH_NAME="${ref}" echo "Extracted values - v: $v - BRANCH_NAME: $BRANCH_NAME"