Add action, dockerfile, entrypoint

This commit is contained in:
Ilir Bekteshi 2019-10-16 10:43:28 +02:00
parent 301f739d5f
commit db8f332c96
3 changed files with 39 additions and 0 deletions

8
Dockerfile Normal file
View file

@ -0,0 +1,8 @@
FROM python:3-alpine
RUN pip install yamllint && \
rm -rf ~/.cache/pip
ADD entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

24
action.yml Normal file
View file

@ -0,0 +1,24 @@
name: 'YAMLLint'
description: 'Validate YAML syntax'
author: 'ibiqlik'
inputs:
file_or_dir:
description: 'File(s) or Directory'
required: true
config_file:
description: 'Path to custom configuration'
required: false
config_data:
description: 'Custom configuration (as YAML source)'
required: false
format:
description: 'Format for parsing output [parsable,standard]'
required: false
strict:
description: 'Return non-zero exit code on warnings as well as errors'
required: false
runs:
using: 'docker'
image: 'Dockerfile'

7
entrypoint.sh Normal file
View file

@ -0,0 +1,7 @@
#!/bin/sh -l
if [ ! -z $INPUT_STRICT ]; then
STRICT="-s"
fi
yamllint $INPUT_CONFIG_FILE $INPUT_CONFIG_DATA $INPUT_FORMAT $STRICT $INPUT_FILE_OR_DIR