Skip to content
package

GitHub Action

actions-validate-yaml

v1.0 Latest version

actions-validate-yaml

package

actions-validate-yaml

GitHub Action to validate yaml files using https://github.com/gerald1248/validate-yaml

Installation

Copy and paste the following snippet into your .yml file.

              

- name: actions-validate-yaml

uses: RomanosTrechlis/[email protected]

Learn more about this action in RomanosTrechlis/actions-validate-yaml

Choose a version

GitHub actions Validate YAML

Validate YAML files with a JSON schema. Using validate-yaml

GitHub actions configuration

In order to use RomanosTrechlis/actions-validate-yaml, follow the instructions bellow:

  1. Create the .github/workflows directory in your root directory
  2. Create a yml file with an appropriate name
  3. Copy the following script into that file
  4. Change input variables
  5. Commit and push
on:
  push:
    paths:
      - '**.yml'
      - '**.yaml'
release:
  types: [created]

name: Validate YAML
jobs:
  releases-matrix:
    name: Validate YAML
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: RomanosTrechlis/actions-validate-yaml@master
        with:
          schema: spec.json
          data: |-
            file1.yml
            file2.yml

Input variables

There are two input for this action:

  1. schema: is the schema specification in .json or .yaml file
  2. data: a string of multiple files to validate separated by new line