yamllint/entrypoint.sh
Petr Ruzicka cf0212bc66 Use the current directory as default path for yamllint
Use the current directory as default path for yamllint.
It's a handy default option which allows yamllint to check all yaml
files in repository by default (which is usually the use case).
2020-01-27 11:11:33 +01:00

23 lines
508 B
Bash
Executable file

#!/bin/sh -l
echo "======================"
echo "= Linting YAML files ="
echo "======================"
# Use the current directory by default
export INPUT_FILE_OR_DIR=${INPUT_FILE_OR_DIR:-.}
STRICT=""
if [ "$INPUT_STRICT" == "true" ]; then
STRICT="-s"
fi
if [ ! -z "$INPUT_CONFIG_FILE" ]; then
CONFIG_FILE="-c $INPUT_CONFIG_FILE"
fi
if [ ! -z "$INPUT_CONFIG_DATA" ]; then
CONFIG_DATA="-d $INPUT_CONFIG_DATA"
fi
yamllint $CONFIG_FILE $CONFIG_DATA -f $INPUT_FORMAT $STRICT $INPUT_FILE_OR_DIR