Skip to content

Files

Latest commit

1c675d9 · Feb 22, 2019

History

History
This branch is up to date with stephenmoloney/ci-actions-copyleft:master.

yamllint

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 21, 2019
Feb 22, 2019
Feb 22, 2019

ci-actions-yamllint

License Image Size Image Version Docker Pulls

ci-actions-yamllint is an action for linting yaml files.

The image is available on the dockerhub as smoloney/ci-actions-yamllint.

Usage

Github actions workflow example

action "yamllint" {
  uses = "stephenmoloney/ci-actions-copyleft/yamllint@master",
  args = [
          "--exclude=./k8s/charts",
          "--file-glob='*.y*ml'",
          "--exec-args='yamllint --strict --config-file=./yamllint'"
         ]
}

Gitlab-CI workflow example

docker run --rm -v "${PWD}":/ci-actions/workspace smoloney/ci-actions-yamllint:latest \
  --exclude='./test/ci-yamllint/ignore-dir' \
  --exclude='./test/ci-yamllint/ignore-fail.yaml' \
  --file-glob='*.y*ml' \
  --exec-args='yamllint --strict --config-file=.yamllint.yml'

docker run --rm -v "${PWD}":/ci-actions/workspace smoloney/ci-actions-yamllint:latest
--exec-args='yamllint --strict --config-file=.yamllint.yml'

Arguments

Usage:
docker run \
  --rm \
  -v ${PWD}:${WORKSPACE} smoloney/ci-actions-yamllint:latest \
  [--exec_args EXEC_ARGS] [--exclude EXCLUDE...] [--file-glob FILE_GLOB]

Options:
  --exec_args Executable arguments to be passed to yammlint
  --file_glob The type of file to be found based on file extension. '*.y*ml' is recommended.
  --exclude (repeatable arg) directories to be ignored

Arguments - exclusion paths

To exclude particular paths whether files or folders, enter them as follows:

--exclude='./k8s/test-charts' --exclude='.yamllint.yml'

Arguments - executable arguments

The command to executed is configurable. Run yamllint --help for options and/or documentation.

--exec-args='yamllint --strict --config-file=.yamllint.yml'

License

GPLv3