Coder Social home page Coder Social logo

nilzona / yaml-schema-validator-github-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nrkno/yaml-schema-validator-github-action

0.0 0.0 0.0 31 KB

A GitHub action that uses Yamale for YAML schema validation

License: MIT License

Shell 77.49% Dockerfile 22.51%

yaml-schema-validator-github-action's Introduction

yaml-schema-validator-github-action

A GitHub action that uses Yamale for YAML schema validation.

Usage

  • Filenames are relative to the repository root.
  • Disable strict checking by setting no-strict to true, 1 or yes.
  • For help with the schema definitions and reference, see Yamale.

The following example sets up a check to validate a YAML file in your repository, target.yaml, using a schema defined in schemas/schema.yaml:

name: YAML schema validator
on: [push]

jobs:
  yaml-schema-validation:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: nrkno/yaml-schema-validator-github-action@v4
      with:
        schema: schemas/schema.yaml
        target: target.yaml
        # and/or use (optional)
        target-glob-path: a/glob/**/pattern/.yaml
        # Uncomment to disable strict checks
        # no-strict: true

Versioning

This action is meant to be a wrapper around Yamale, so as of version 4.x of Yamale, this action will follow Yamale's major version scheme.

To bind the action to a specific release, suffix with @<tag>. E.g. nrkno/yaml-schema-validator-github-action@v4.

https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsuses

Developing

Create and enable a Python virtualenv

python -m venv venv
source venv/bin/activate

Install dependencies

pip install -r requirements.txt

Do a test-run with one of the provided examples

$ INPUT_SCHEMA=example/schema.yaml \
  INPUT_TARGET=example/file-valid-strict.yaml \
  ./entrypoint.sh

If you want to use a path glob pattern use

$ INPUT_SCHEMA=example/schema.yaml \
  INPUT_TARGET_PATH_GLOB=example/*.yaml \
  ./entrypoint.sh

yaml-schema-validator-github-action's People

Contributors

stigok avatar dependabot[bot] avatar nilzona avatar ibiqlik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.