From f495889b63066c7763b6bfa58745e9c8eeb2a14e Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Tue, 6 Jul 2021 17:19:06 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..e68a962 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,17 @@ +# you can delete this line if you're not using Docker +#image: busybox:latest + +shellcheck: + stage: test + image: registry.gitlab.com/pipeline-components/shellcheck:latest + script: + # anything ending on .sh, should be shell script + - | + find . -name .git -type d -prune -o -type f -name \*.sh -print0 | + xargs -0 -P $(nproc) -r -n1 shellcheck + # magic, any file with a valid shebang should be scanned aswell + - | + find . -name .git -type d -prune -o -type f -regex '.*/[^.]*$' -print0 | + xargs -0 -P $(nproc) -r -n1 sh -c 'FILE="$0"; if head -n1 "$FILE" |grep -q "^#\\! \?/.\+\(ba|d|k\)\?sh" ; then shellcheck "$FILE" ; else /bin/true ; fi ' + +