File tree Expand file tree Collapse file tree 2 files changed +22
-13
lines changed
Expand file tree Collapse file tree 2 files changed +22
-13
lines changed Original file line number Diff line number Diff line change @@ -4,18 +4,15 @@ This action executes `yamllint` (https://github.com/adrienverge/yamllint) agains
44
55## Usage
66
7- ### Required parameters
8-
9- - ` file_or_dir ` - Enter file/folder (space speparated), wildcards accepted. Examples:
10- - ` file1.yaml `
11- - ` file1.yaml file2.yaml `
12- - ` . ` - run against all yaml files in a directory recursively
13- - ` kustomize/**/*.yaml mychart/*values.yaml `
14-
157### Optional parameters
168
179- ` config_file ` - Path to custom configuration
1810- ` config_data ` - Custom configuration (as YAML source)
11+ - ` file_or_dir ` - Enter file/folder (space separated), wildcards accepted. Examples:
12+ - ` . ` - run against all yaml files in a directory recursively (default)
13+ - ` file1.yaml `
14+ - ` file1.yaml file2.yaml `
15+ - ` kustomize/**/*.yaml mychart/*values.yaml `
1916- ` format ` - Format for parsing output [ parsable,standard,colored,auto]
2017- ` strict ` - Return non-zero exit code on warnings as well as errors [ true,false]
2118
3532 file_or_dir : myfolder/*values*.yaml
3633 config_file : .yamllint.yml
3734` ` `
35+
36+ Or just simply check all yaml files in the repository:
37+
38+ ` ` ` yaml
39+ name : Yaml Lint
40+ on : [push]
41+ jobs :
42+ lintAllTheThings :
43+ runs-on : ubuntu-latest
44+ steps :
45+ - uses : actions/checkout@master
46+ - name : yaml-lint
47+ uses : ibiqlik/action-yamllint@master
48+ ` ` `
Original file line number Diff line number Diff line change @@ -4,10 +4,8 @@ echo "======================"
44echo " = Linting YAML files ="
55echo " ======================"
66
7- if [ -z " INPUT_FILE_OR_DIR" ]; then
8- echo " file_or_dir not provided, add it in workflow"
9- exit 1
10- fi
7+ # Use the current directory by default
8+ export INPUT_FILE_OR_DIR=${INPUT_FILE_OR_DIR:- .}
119
1210STRICT=" "
1311if [ " $INPUT_STRICT " == " true" ]; then
@@ -22,4 +20,4 @@ if [ ! -z "$INPUT_CONFIG_DATA" ]; then
2220 CONFIG_DATA=" -d $INPUT_CONFIG_DATA "
2321fi
2422
25- yamllint $CONFIG_FILE $CONFIG_DATA -f $INPUT_FORMAT $STRICT $INPUT_FILE_OR_DIR
23+ yamllint $CONFIG_FILE $CONFIG_DATA -f $INPUT_FORMAT $STRICT $INPUT_FILE_OR_DIR
You can’t perform that action at this time.
0 commit comments