From 7b63f256e51f348436c4de66121730ffa26138dc Mon Sep 17 00:00:00 2001 From: Dan Mihai Date: Thu, 6 Mar 2025 20:28:41 +0000 Subject: [PATCH] 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 --- tests/git-helper.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/git-helper.sh b/tests/git-helper.sh index edf935886e..7344626899 100755 --- a/tests/git-helper.sh +++ b/tests/git-helper.sh @@ -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}"