yamllint/entrypoint.sh

28 lines
545 B
Bash
Raw Normal View History

#!/bin/bash -l
2019-10-16 04:43:28 -04:00
echo "======================"
echo "= Linting YAML files ="
echo "======================"
if [[ -n "$INPUT_CONFIG_FILE" ]]; then
options+=(-c "$INPUT_CONFIG_FILE")
2019-10-16 04:43:28 -04:00
fi
if [[ -n "$INPUT_CONFIG_DATA" ]]; then
options+=(-d "$INPUT_CONFIG_DATA")
fi
options+=(-f "$INPUT_FORMAT")
if [[ "$INPUT_STRICT" == "true" ]]; then
options+=(-s)
fi
# Enable globstar so ** globs recursively
shopt -s globstar
# Use the current directory by default
2020-11-08 12:54:33 -05:00
options+=("${INPUT_FILE_OR_DIR:-.}")
shopt -u globstar
yamllint "${options[@]}"