This action runs a YAML Linter on YAML files in the repository
See yaml-linter.yml
on: push
name: Yaml Lint
jobs:
yaml_lint:
name: Yaml Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Yaml Lint
uses: kapost/yaml-linter@v1
env:
CUSTOM_CONFIG: custom-yaml.yml # <-- Optional
TARGET_DIRECTORY: ./my-directory # <-- Optional
CUSTOM_CONFIG
- not required: This variable allows for a custom config to be specified - the full path must be provided although it is easier to have the config file at the root level of the repository
TARGET_DIRECTORY
- not required: This variable allows for a specific directory to be targeted for linting
---
yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'
rules:
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
empty-lines: enable
empty-values: disable
float-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length: enable
new-line-at-end-of-file: enable
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning
---
yaml-files:
- '*.yaml'
- '*.yml'
- '.yamllint'
rules:
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
empty-lines: enable
empty-values: disable
float-values: disable
hyphens: enable
indentation: enable
key-duplicates: enable
key-ordering: disable
line-length: enable
new-line-at-end-of-file: enable
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning
For custom config information refer to the Yaml Lint configuration documentation