Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (64 sloc) 2.87 KB

YAML linter Action

GitHub Marketplace Actions Status Actions Status

This action will lint YAML files in your project.

Usage

Describe how to use your action here.

Example workflow

name: My Workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Run action
      uses: jacobtomlinson/gha-lint-yaml@master
      with:
        path: path/to/my/yaml/file.yaml

Inputs

Input Description
path Path to the YAML file to be linted.
strict (optional) Run the linter in strict mode (error on warnings).

Outputs

Output Description
warnings The number of warnings raised if successful.

Examples

Running in strict mode

Here is an example of a very strict linting job.

name: My Workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Run action
      uses: jacobtomlinson/gha-lint-yaml@master
      with:
        path: path/to/my/yaml/file.yaml
        strict: true

Using outputs

Here is an example of using the warnings outputs.

name: My Workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Run action
      id: yamllint
      uses: jacobtomlinson/gha-lint-yaml@master
      with:
        path: path/to/my/yaml/file.yaml

    - name: Check outputs
        run: |
          echo "There were ${{ steps.yamllint.outputs.warnings }} YAML linting warnings."
You can’t perform that action at this time.