11# GitHub YAMLlint
22
3- This action executes ` yamllint ` (https://github.com/adrienverge/yamllint ) against file(s) or folder
3+ This action executes ` yamllint ` (https://github.com/adrienverge/yamllint ) against files or folder
44
55## Usage
66
@@ -10,7 +10,7 @@ Simple as:
1010- uses : ibiqlik/action-yamllint@v3
1111` ` `
1212
13- ### Optional parameters
13+ ### Optional input parameters
1414
1515- ` config_file` - Path to custom configuration
1616- ` config_data` - Custom configuration (as YAML source)
@@ -23,37 +23,47 @@ Simple as:
2323- `strict` - Return non-zero exit code on warnings as well as errors `[true,false] (default : false)`
2424- `no_warnings` - Output only error level problems `[true,false] (default : false)`
2525
26- **Note:** If `.yamllint` configuration file exists in your root folder, yamllint will automatically use it.
26+ **Note:** If `.yamllint` configuration file exists in your root folder, yamllint automatically uses it.
27+
28+ # ## Outputs
29+
30+ ` logfile` - Path to yamllint log file
31+
32+ ` ${{ steps.<step>.outputs.logfile }}`
33+
34+ **Note:** Each yamllint run (for example if you define multiple yamllint steps) has its own log
2735
2836# ## Example usage in workflow
2937
3038` ` ` yaml
39+ ---
3140name: Yaml Lint
32- on: [push]
41+ on: [push] # yamllint disable-line rule:truthy
3342jobs:
3443 lintAllTheThings:
3544 runs-on: ubuntu-latest
3645 steps:
37- - uses: actions/checkout@v1
38- - name: yaml-lint
39- uses: ibiqlik/action-yamllint@v3
40- with:
41- file_or_dir: myfolder/*values*.yaml
42- config_file: .yamllint.yml
46+ - uses: actions/checkout@v2
47+ - name: yaml-lint
48+ uses: ibiqlik/action-yamllint@v3
49+ with:
50+ file_or_dir: myfolder/*values*.yaml
51+ config_file: .yamllint.yml
4352` ` `
4453
45- Or just simply check all yaml files in the repository :
54+ Or just simply lint all yaml files in the repository :
4655
4756` ` ` yaml
57+ ---
4858name: Yaml Lint
49- on: [push]
59+ on: [push] # yamllint disable-line rule:truthy
5060jobs:
5161 lintAllTheThings:
5262 runs-on: ubuntu-latest
5363 steps:
54- - uses: actions/checkout@v2
55- - name: yaml-lint
56- uses: ibiqlik/action-yamllint@v3
64+ - uses: actions/checkout@v2
65+ - name: yaml-lint
66+ uses: ibiqlik/action-yamllint@v3
5767` ` `
5868
5969Config data examples :
@@ -73,3 +83,26 @@ config_data: |
7383 trailing-spaces:
7484 level: warning
7585` ` `
86+
87+ Use output to save/upload the log in artifact. Note, you must have `id` in the step running the yamllint action.
88+
89+ ` ` ` yaml
90+ ---
91+ name: Yaml Lint
92+ on: [push] # yamllint disable-line rule:truthy
93+ jobs:
94+ lintAllTheThings:
95+ runs-on: ubuntu-latest
96+ steps:
97+ - uses: actions/checkout@v2
98+ - id: yaml-lint
99+ uses: ibiqlik/action-yamllint@v3
100+
101+ - run: echo ${{ steps.yaml-lint.outputs.logfile }}
102+
103+ - uses: actions/upload-artifact@v2
104+ if: always()
105+ with:
106+ name: yamllint-logfile
107+ path: ${{ steps.yaml-lint.outputs.logfile }}
108+ ` ` `
0 commit comments