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

This commit is contained in:
Stephan Schnabel 2025-06-14 13:50:00 +02:00
parent c5391b5a98
commit da82c0f30a
Signed by: stephan.schnabel
SSH key fingerprint: SHA256:99zuzxNGFb5/5P+E/O7ONU2qhUojUe/D8rIPTW+9Xp0
16 changed files with 755 additions and 0 deletions

43
entrypoint.sh Executable file
View file

@ -0,0 +1,43 @@
#!/bin/bash
set -eu;
##
## check if any markdown file is present
##
FILES=$(find "$(pwd)" -type f -name '*.md')
if [[ ! "$FILES" ]]; then
echo "No markdown file found!"
exit 1
fi
##
## build command
##
COMMAND="markdownlint"
if [[ -n "${PLUGIN_CONFIG_FILE:-}" ]]; then
COMMAND+=" --config=$PLUGIN_CONFIG_FILE"
fi
if [[ "${PLUGIN_DOT:-true}" == "true" ]]; then
COMMAND+=" --dot"
fi
if [[ -n "${PLUGIN_ENABLE:-}" ]]; then
COMMAND+=" --enable=$PLUGIN_ENABLE"
fi
if [[ -n "${PLUGIN_DISABLE:-}" ]]; then
COMMAND+=" --disable=$PLUGIN_DISABLE"
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
##
## build environment
##
echo "$COMMAND"
eval "$COMMAND"