Ensure shellcheck failure exit code is reflected in GH job result
This commit is contained in:
parent
0a6b8780f0
commit
ab35b3266a
3 changed files with 12 additions and 5 deletions
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2046
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
# shellcheck disable=SC1091 # Cannot check source of this file
|
||||
source /go/src/k8s.io/code-generator/kube_codegen.sh
|
||||
|
||||
git config --global --add safe.directory "/go/src/${PROJECT_MODULE}"
|
||||
|
|
|
@ -15,9 +15,9 @@ for os in linux darwin windows freebsd openbsd; do
|
|||
go clean -cache
|
||||
done
|
||||
|
||||
cat dist/**/*_checksums.txt >> dist/traefik_${VERSION}_checksums.txt
|
||||
cat dist/**/*_checksums.txt >> "dist/traefik_${VERSION}_checksums.txt"
|
||||
rm dist/**/*_checksums.txt
|
||||
tar cfz dist/traefik-${VERSION}.src.tar.gz \
|
||||
tar cfz "dist/traefik-${VERSION}.src.tar.gz" \
|
||||
--exclude-vcs \
|
||||
--exclude .idea \
|
||||
--exclude .travis \
|
||||
|
@ -25,4 +25,4 @@ tar cfz dist/traefik-${VERSION}.src.tar.gz \
|
|||
--exclude .github \
|
||||
--exclude dist .
|
||||
|
||||
chown -R $(id -u):$(id -g) dist/
|
||||
chown -R "$(id -u)":"$(id -g)" dist/
|
||||
|
|
|
@ -6,6 +6,7 @@ script_dir="$( cd "$( dirname "${0}" )" && pwd -P)"
|
|||
|
||||
if command -v shellcheck
|
||||
then
|
||||
exit_code=0
|
||||
# The list of shell script come from the (grep ...) command, feeding the loop
|
||||
while IFS= read -r script_to_check
|
||||
do
|
||||
|
@ -18,7 +19,13 @@ then
|
|||
| grep -v '.git/' | grep -v 'vendor/' | grep -v 'node_modules/' \
|
||||
| cut -d':' -f1
|
||||
)
|
||||
wait # Wait for all background command to be completed
|
||||
# Wait for all background command to be completed
|
||||
for p in $(jobs -p)
|
||||
do
|
||||
wait "$p" || exit_code=$?
|
||||
done
|
||||
exit $exit_code
|
||||
else
|
||||
echo "== Command shellcheck not found in your PATH. No shell script checked."
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue