gha: fix git-helper issues reported by shellcheck

./tests/git-helper.sh:20:5: note: Prefer [[ ]] over [ ] for tests in Bash/Ksh. [SC2292]
./tests/git-helper.sh:22:26: note: Double quote to prevent globbing and word splitting. [SC2086]
./tests/git-helper.sh:23:7: note: Prefer [[ ]] over [ ] for tests in Bash/Ksh. [SC2292]

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
Dan Mihai 2025-03-06 20:28:41 +00:00
parent 04adcdace6
commit 7b63f256e5

View File

@ -17,10 +17,10 @@ function add_kata_bot_info() {
}
function rebase_atop_of_the_latest_target_branch() {
if [ -n "${TARGET_BRANCH}" ]; then
if [[ -n "${TARGET_BRANCH}" ]]; then
echo "Rebasing atop of the latest ${TARGET_BRANCH}"
if ! git rebase origin/${TARGET_BRANCH}; then
if [ -n "${GITHUB_WORKSPACE}" ] ; then
if ! git rebase "origin/${TARGET_BRANCH}"; then
if [[ -n "${GITHUB_WORKSPACE}" ]] ; then
echo "Rebase failed, cleaning up the local repository and exiting"
cd "${GITHUB_WORKSPACE}"/..
sudo rm -rf "${GITHUB_WORKSPACE}"