mirror of
https://github.com/ibiqlik/action-yamllint.git
synced 2024-11-23 10:09:33 +01:00
cf0212bc66
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).
23 lines
508 B
Bash
Executable file
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
|