Skip to content

fix: add shellcheck and fix a few warnings #22569

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
branches:
- 'master'
- 'release-*'
workflow_dispatch:

env:
# Golang version to use across CI steps
Expand Down Expand Up @@ -333,6 +334,15 @@ jobs:
run: yarn lint
working-directory: ui/

shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8410ad0602e1e429cee44a835ae9f77f654a6694 # v4.0.0
- run: |
sudo apt-get install shellcheck
shellcheck -e SC2086 -e SC2046 -e SC2068 -e SC2206 -e SC2048 -e SC2059 -e SC2154 -e SC2034 -e SC2016 -e SC2128 -e SC1091 -e SC2207 $(find . -type f -name '*.sh') | tee sc.log
test ! -s sc.log

analyze:
name: Process & analyze test artifacts
if: ${{ needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true' }}
Expand Down
Empty file removed generate-snyk-report.sh
Empty file.
4 changes: 3 additions & 1 deletion hack/generate-actions-list.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
find resource_customizations -name action.lua | sed 's/resource_customizations\/\(.*\)\/actions\/\(.*\)\/action.lua/- [\1\/\2](https:\/\/github.com\/argoproj\/argo-cd\/blob\/master\/resource_customizations\/\1\/actions\/\2\/action.lua)/' | sort | uniq > docs/operator-manual/resource_actions_builtin.md
#!/usr/bin/env bash

find resource_customizations -name action.lua | sed 's/resource_customizations\/\(.*\)\/actions\/\(.*\)\/action.lua/- [\1\/\2](https:\/\/github.com\/argoproj\/argo-cd\/blob\/master\/resource_customizations\/\1\/actions\/\2\/action.lua)/' | sort | uniq > docs/operator-manual/resource_actions_builtin.md
2 changes: 1 addition & 1 deletion hack/trigger-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fi

# Target (version) tag must match version scheme vMAJOR.MINOR.PATCH with an
# optional pre-release tag.
if ! echo "${NEW_TAG}" | egrep -q '^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then
if ! echo "${NEW_TAG}" | grep -E -q '^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)*$'; then
echo "!! Malformed version tag: '${NEW_TAG}', must match 'vMAJOR.MINOR.PATCH(-rcX)'" >&2
exit 1
fi
Expand Down
4 changes: 3 additions & 1 deletion test/e2e/testdata/cmp-preserve-file-mode/script.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash

cat << EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: test-cm
data:
foo: bar
EOF
EOF
4 changes: 2 additions & 2 deletions ui/scripts/build_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set -e

TAG=${IMAGE_TAG:-'latest'}

docker build --build-arg ARGO_VERSION=${TAG} -t ${IMAGE_NAMESPACE:-`whoami`}/argocd-ui:${TAG} .
docker build --build-arg ARGO_VERSION=${TAG} -t ${IMAGE_NAMESPACE:-$(whoami)}/argocd-ui:${TAG} .

if [ "$DOCKER_PUSH" == "true" ]
then
docker push ${IMAGE_NAMESPACE:-`whoami`}/argocd-ui:${TAG}
docker push ${IMAGE_NAMESPACE:-$(whoami)}/argocd-ui:${TAG}
fi
4 changes: 3 additions & 1 deletion util/io/files/testdata/executable/script.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
echo hello world
#!/usr/bin/env bash

echo hello world
Loading