mirror of
https://github.com/ibiqlik/action-yamllint.git
synced 2024-11-22 06:11:00 -05:00
parent
76fdac3839
commit
b2aeacc1b7
4 changed files with 23 additions and 21 deletions
10
README.md
10
README.md
|
@ -7,7 +7,7 @@ This action executes `yamllint` (https://github.com/adrienverge/yamllint) agains
|
||||||
Simple as:
|
Simple as:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: ibiqlik/action-yamllint@v2
|
- uses: ibiqlik/action-yamllint@v3
|
||||||
```
|
```
|
||||||
|
|
||||||
### Optional parameters
|
### Optional parameters
|
||||||
|
@ -22,6 +22,8 @@ Simple as:
|
||||||
- `format` - Format for parsing output [parsable,standard,colored,github,auto] (default: github)
|
- `format` - Format for parsing output [parsable,standard,colored,github,auto] (default: github)
|
||||||
- `strict` - Return non-zero exit code on warnings as well as errors [true,false] (default: false)
|
- `strict` - Return non-zero exit code on warnings as well as errors [true,false] (default: false)
|
||||||
|
|
||||||
|
**Note:** If `.yamllint` configuration file exists in your root folder, yamllint will automatically use it.
|
||||||
|
|
||||||
### Example usage in workflow
|
### Example usage in workflow
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -33,7 +35,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: yaml-lint
|
- name: yaml-lint
|
||||||
uses: ibiqlik/action-yamllint@v2
|
uses: ibiqlik/action-yamllint@v3
|
||||||
with:
|
with:
|
||||||
file_or_dir: myfolder/*values*.yaml
|
file_or_dir: myfolder/*values*.yaml
|
||||||
config_file: .yamllint.yml
|
config_file: .yamllint.yml
|
||||||
|
@ -50,11 +52,9 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: yaml-lint
|
- name: yaml-lint
|
||||||
uses: ibiqlik/action-yamllint@v2
|
uses: ibiqlik/action-yamllint@v3
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note:** Action will use `.yamllint` as configuration file automatically if it is available in root.
|
|
||||||
|
|
||||||
Config data examples:
|
Config data examples:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
18
action.yml
18
action.yml
|
@ -22,14 +22,16 @@ inputs:
|
||||||
default: "false"
|
default: "false"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'composite'
|
||||||
image: 'Dockerfile'
|
steps:
|
||||||
args:
|
- run: ${{ github.action_path }}/entrypoint.sh
|
||||||
- ${{ inputs.file_or_dir }}
|
shell: bash
|
||||||
- ${{ inputs.config_file }}
|
env:
|
||||||
- ${{ inputs.config_data }}
|
INPUT_FILE_OR_DIR: ${{ inputs.file_or_dir }}
|
||||||
- ${{ inputs.format }}
|
INPUT_CONFIG_FILE: ${{ inputs.config_file }}
|
||||||
- ${{ inputs.strict }}
|
INPUT_CONFIG_DATA: ${{ inputs.config_data }}
|
||||||
|
INPUT_FORMAT: ${{ inputs.format }}
|
||||||
|
INPUT_STRICT: ${{ inputs.strict }}
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
color: blue
|
color: blue
|
||||||
|
|
|
@ -21,7 +21,7 @@ fi
|
||||||
# Enable globstar so ** globs recursively
|
# Enable globstar so ** globs recursively
|
||||||
shopt -s globstar
|
shopt -s globstar
|
||||||
# Use the current directory by default
|
# Use the current directory by default
|
||||||
options+=(${INPUT_FILE_OR_DIR:-.})
|
options+=("${INPUT_FILE_OR_DIR:-.}")
|
||||||
shopt -u globstar
|
shopt -u globstar
|
||||||
|
|
||||||
yamllint "${options[@]}"
|
yamllint "${options[@]}"
|
||||||
|
|
Loading…
Reference in a new issue