diff --git a/.github/workflows/bash_formatter.yaml b/.github/workflows/bash_formatter.yaml index 7c992f8ab8..c2384f1037 100644 --- a/.github/workflows/bash_formatter.yaml +++ b/.github/workflows/bash_formatter.yaml @@ -38,7 +38,17 @@ jobs: run: cat changed_files_in_PR.txt || echo "No bash files have changed in this PR." - name: Run ShellCheck on changed files - if: steps.changed_files.outputs.changed_files != '' + id: lint run: | - cat changed_files_in_PR.txt | xargs -I {} shellcheck {} || echo "No changes needed for the bash files." + if grep -q 'No bash files have changed in this PR.' changed_files_in_PR.txt; then + echo "No bash files have changed in this PR." + else + cat changed_files_in_PR.txt | xargs -I {} shellcheck {} || exit 1 + fi + shell: bash + + - name: Check Bash lint results + if: success() && steps.lint.outcome == 'success' + run: echo "No styling issues with Bash files." shell: bash + diff --git a/hack/synchronize-istio-cni-manifests.sh b/hack/synchronize-istio-cni-manifests.sh index bbfb494d2d..3512da2651 100644 --- a/hack/synchronize-istio-cni-manifests.sh +++ b/hack/synchronize-istio-cni-manifests.sh @@ -44,7 +44,7 @@ then fi # Create the branch in the manifests repository - if ! git show-ref --verify --quiet refs/heads/$BRANCH; then + if ! git show-ref --verify --quiet refs/heads/$BRANCH; then git checkout -b $BRANCH else echo "Branch $BRANCH already exists."