Skip to content

Commit 26e96b3

Browse files
authored
Merge pull request #1 from ruzickap/enhancement-default_path
Use the current directory as default path for yamllint
2 parents 0080381 + cf0212b commit 26e96b3

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff 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

@@ -35,3 +32,17 @@ jobs:
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+
```

entrypoint.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ echo "======================"
44
echo "= Linting YAML files ="
55
echo "======================"
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

1210
STRICT=""
1311
if [ "$INPUT_STRICT" == "true" ]; then
@@ -22,4 +20,4 @@ if [ ! -z "$INPUT_CONFIG_DATA" ]; then
2220
CONFIG_DATA="-d $INPUT_CONFIG_DATA"
2321
fi
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

0 commit comments

Comments
 (0)