Initial plugin source.

This commit is contained in:
Stephan Schnabel 2025-02-03 11:46:21 +01:00
parent 5dc432e619
commit 99fdd9fcae
Signed by: stephan.schnabel
GPG key ID: 115DFD33787FABF7
16 changed files with 705 additions and 0 deletions

41
entrypoint.sh Executable file
View file

@ -0,0 +1,41 @@
#!/bin/bash
set -eu;
##
## check if any yaml file is present
##
FILES=$(find "$(pwd)" -type f -name '*.yml' -o -name '*.yaml')
if [[ ! "$FILES" ]]; then
echo "No yaml file found!"
exit 1
fi
##
## build command
##
COMMAND="yamllint"
if [[ -n "${PLUGIN_CONFIG_FILE:-}" ]]; then
COMMAND="$COMMAND --config-file=$PLUGIN_CONFIG"
fi
COMMAND="$COMMAND --format=${PLUGIN_FORMAT:-colored}"
if [[ "${PLUGIN_STRICT:-true}" == "true" ]]; then
COMMAND="$COMMAND --strict"
fi
if [[ "${PLUGIN_NO_WARNINGS:-}" == "true" ]]; then
COMMAND="$COMMAND --no-warnings"
fi
COMMAND="$COMMAND $(pwd)"
# custom args, e.g. docker run --rm --volume=$(pwd):$(pwd) --workdir=$(pwd) --env=CI=test kokuwaio/yamllint --format=json
if [[ -n "${1:-}" ]]; then
COMMAND="$COMMAND $*"
fi
##
## evecute command
##
echo "$COMMAND"
eval "$COMMAND"