2019-10-16 10:43:28 +02:00
|
|
|
#!/bin/sh -l
|
|
|
|
|
2019-12-17 12:50:34 +01:00
|
|
|
echo "======================"
|
|
|
|
echo "= Linting YAML files ="
|
|
|
|
echo "======================"
|
|
|
|
|
2019-12-17 14:15:23 +01:00
|
|
|
if [ -z "INPUT_FILE_OR_DIR" ]; then
|
|
|
|
echo "file_or_dir not provided, add it in workflow"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
STRICT=""
|
|
|
|
if [ "$INPUT_STRICT" == "true" ]; then
|
2019-10-16 10:43:28 +02:00
|
|
|
STRICT="-s"
|
|
|
|
fi
|
|
|
|
|
2019-10-16 10:47:45 +02:00
|
|
|
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
|
|
|
|
|
2019-12-17 14:15:23 +01:00
|
|
|
yamllint $CONFIG_FILE $CONFIG_DATA -f $INPUT_FORMAT $STRICT $INPUT_FILE_OR_DIR
|