Initial draft of plugin.
All checks were successful
ci/woodpecker/push/dockerhub Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test/1 Pipeline was successful
ci/woodpecker/push/test/2 Pipeline was successful
ci/woodpecker/manual/dockerhub Pipeline was successful
ci/woodpecker/manual/lint Pipeline was successful
ci/woodpecker/manual/build Pipeline was successful
ci/woodpecker/manual/test/1 Pipeline was successful
ci/woodpecker/manual/test/2 Pipeline was successful

This commit is contained in:
Stephan Schnabel 2025-06-17 23:28:35 +02:00
parent 2fe1a4ebb8
commit a01b3aad0f
Signed by: stephan.schnabel
SSH key fingerprint: SHA256:99zuzxNGFb5/5P+E/O7ONU2qhUojUe/D8rIPTW+9Xp0
16 changed files with 713 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+=" --config-file=$PLUGIN_CONFIG"
fi
COMMAND+=" --format=${PLUGIN_FORMAT:-colored}"
if [[ "${PLUGIN_STRICT:-true}" == "true" ]]; then
COMMAND+=" --strict"
fi
if [[ "${PLUGIN_NO_WARNINGS:-}" == "true" ]]; then
COMMAND+=" --no-warnings"
fi
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+=" $*"
fi
##
## execute command
##
echo "$COMMAND"
eval "$COMMAND"