Skip to content

Commit

Permalink
workflows/meta-balena-esr: fix version array bash
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: Ryan Cooke <[email protected]>
  • Loading branch information
rcooke-warwick committed Oct 23, 2024
1 parent d6ed535 commit ee7edcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/meta-balena-esr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
git fetch --tags origin
current_os_version=$(git describe --abbrev=0 "$(git rev-list --tags --max-count=1)")
current_os_version="${current_os_version:1}"
va=("${current_os_version//./ }")
IFS="." read -r -a va <<< "${current_os_version}"
if [ ${#va[@]} -ne 3 ]; then
echo "Invalid current version: ${current_os_version}"
exit 1
Expand All @@ -107,7 +107,7 @@ jobs:
os_version=$(git tag --sort -version:refname | grep "v${va[0]}\." | head -n1)
fi
os_version="${os_version:1}"
ov_arr=( "${os_version//./ }" )
IFS="." read -r -a ov_arr <<< "${os_version}"
os_esr_branch=${ov_arr[0]}.${ov_arr[1]}.x
if git ls-remote --exit-code --heads origin "${os_esr_branch}" > /dev/null; then
echo "Branch ${os_esr_branch} already exists"
Expand Down

0 comments on commit ee7edcf

Please sign in to comment.