From 79dfd71002ddc4448a5779f4c3bdfa356fc20dd5 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Wed, 1 May 2024 12:00:06 +0100 Subject: [PATCH] Fix integer comparison error by ensuring GITHUB_CI_CD is defined (#170) This commit resolves the error encountered when GITHUB_CI_CD is unset or non-integer by defaulting it to 0. --- scripts/env.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/env.sh b/scripts/env.sh index 111183f0..c5f222c3 100755 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -19,6 +19,9 @@ rm md5.txt tar xvjf "${TARBALL}" rm "${TARBALL}" +# Ensure GITHUB_CI_CD is set and is an integer, default to 0 if not set +GITHUB_CI_CD="${GITHUB_CI_CD:-0}" + if [ -n "${GITHUB_CI_PR_SHA}" ] || [ 1 -eq "${GITHUB_CI_CD}" ]; then # This is for GitHub Actions CI/CD tooling only echo "export PATH=\"${CURDIR}/${TARDIR}/bin\":\"\${PATH}\"" > build.env @@ -30,4 +33,3 @@ else echo "to your ~/.profile and/or ~/.bashrc and run the line to enable toolchain as default one for arm-none-eabi-* target" echo "" fi; -