File tree Expand file tree Collapse file tree 7 files changed +36
-16
lines changed Expand file tree Collapse file tree 7 files changed +36
-16
lines changed Original file line number Diff line number Diff line change 1+ name : Lint
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - ' **/*.sh'
7+
8+ jobs :
9+ shellcheck :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout repository
14+ uses : actions/checkout@v4
15+
16+ - name : Install ShellCheck
17+ run : sudo apt-get update && sudo apt-get install -y shellcheck
18+
19+ - name : Run ShellCheck on all scripts
20+ run : |
21+ # Find all .sh files and run shellcheck
22+ # -f gcc makes the output clickable in GitHub UI
23+ shopt -s globstar nullglob
24+ shellcheck -f gcc **/*.sh
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ start_docker () {
2020get_docker_info () {
2121 DOCKER_GID=$( stat -c ' %g' $DOCKER_SOCK )
2222 DOCKER_GROUP=$( stat -c ' %G' $DOCKER_SOCK )
23- EXISTING_GROUP=$( getent group $DOCKER_GID | cut -d: -f1)
23+ EXISTING_GROUP=$( getent group " $DOCKER_GID " | cut -d: -f1)
2424 echo " Docker socket found with GID: $DOCKER_GID (group: $DOCKER_GROUP )"
2525}
2626
@@ -37,14 +37,14 @@ set_user_permissions () {
3737set_user_groups () {
3838 if [[ -z " $EXISTING_GROUP " ]]; then
3939 echo " Creating docker group with GID $DOCKER_GID "
40- groupadd -g $DOCKER_GID docker
40+ groupadd -g " $DOCKER_GID " docker
4141 DOCKER_GROUP=" docker"
4242 else
4343 echo " Using existing group: $EXISTING_GROUP "
4444 DOCKER_GROUP=$EXISTING_GROUP
4545 fi
4646 echo " Adding user envoybuild to group $DOCKER_GROUP " >&2
47- usermod -aG $DOCKER_GROUP envoybuild
47+ usermod -aG " $DOCKER_GROUP " envoybuild
4848}
4949
5050start_docker
@@ -53,9 +53,8 @@ set_user_permissions
5353set_user_groups
5454
5555if [[ -f /entrypoint-extra.sh ]]; then
56+ # shellcheck disable=SC1091
5657 . /entrypoint-extra.sh
5758fi
59+
5860exec gosu envoybuild " $@ "
59- if [[ -f /cleanup.sh ]]; then
60- . /cleanup.sh
61- fi
Original file line number Diff line number Diff line change @@ -8,9 +8,8 @@ if [[ -e /home/envoybuild/.cache ]]; then
88 chown envoybuild:envoybuild /home/envoybuild/.cache
99fi
1010if [[ -f /entrypoint-extra.sh ]]; then
11+ # shellcheck disable=SC1091
1112 . /entrypoint-extra.sh
1213fi
14+
1315exec gosu envoybuild " $@ "
14- if [[ -f /cleanup.sh ]]; then
15- . /cleanup.sh
16- fi
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ COMMON_PACKAGES=(
1414 ca-certificates
1515 libtinfo5
1616 patch)
17- DEV_PACKAGES=()
1817CI_PACKAGES=(git gosu sudo)
1918DEBIAN_PACKAGES=(
2019 aspell
Original file line number Diff line number Diff line change @@ -9,9 +9,8 @@ if [[ -e /home/envoybuild/.cache ]]; then
99 chown envoybuild:envoybuild /home/envoybuild/.cache
1010fi
1111if [[ -f /entrypoint-extra.sh ]]; then
12+ # shellcheck disable=SC1091
1213 . /entrypoint-extra.sh
1314fi
15+
1416exec gosu envoybuild " $@ "
15- if [[ -f /cleanup.sh ]]; then
16- . /cleanup.sh
17- fi
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ append_variant () {
1919 local repo=$1
2020 local variant=$2
2121 local arch=$3
22- local flags
2322
2423 tag=" ${repo} :${variant} -${TAG_SHA} -${arch} "
2524 if ! exists " $tag " ; then
Original file line number Diff line number Diff line change 55set -e
66
77IMAGE_PREFIX=" ${IMAGE_PREFIX:- envoyproxy/ envoy-build-} "
8- GCR_IMAGE_PREFIX=gcr.io/envoy-ci/
98# Enable docker experimental
109export DOCKER_CLI_EXPERIMENTAL=enabled
1110CONTAINER_SHA=" ${CONTAINER_SHA:- $(git log -1 --pretty=format: " %H" .)} "
12- CONTAINER_TAG=" ${CONTAINER_SHA} "
11+ export CONTAINER_TAG=" ${CONTAINER_SHA} "
1312IMAGE_TAGS=()
1413OCI_OUTPUT_DIR=" oci-output"
1514
@@ -83,8 +82,10 @@ export BASE_IMAGE_NAME
8382
8483# Use distro-specific build script if available
8584if [[ " ${OS_DISTRO} " == " debian" && -f " ./debian_build.sh" ]]; then
85+ # shellcheck disable=SC1091
8686 source " ./debian_build.sh"
8787else
88+ # shellcheck disable=SC1091
8889 source " ./build.sh"
8990fi
9091
You can’t perform that action at this time.
0 commit comments