Skip to content

jacobtomlinson/gha-lint-yaml

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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."