fix: we need this guy in here

This commit is contained in:
Neil Hanlon 2021-07-06 17:34:43 -04:00
parent a0848baae4
commit c929e736af
Signed by untrusted user: neil
GPG Key ID: 705BC21EC3C70F34

22
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,22 @@
# 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
variables:
CUSTOM_ENV_CI_REGISTRY: git.rockylinux.org
CUSTOM_ENV_CI_REGISTRY_USER: neil
tags:
- container
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 '