Skip to content

hashicorp/front-matter-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Front Matter Schema Checker

This Github Action checks the schema of YAML front matter.

Usage

---
 name: Check Front Matter
 on: [push]

 jobs:
   front-matter:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
         with:
           fetch-depth: 0
       - name: Get changed files
         id: changed-files
         uses: tj-actions/changed-files@v1.1.3
         with:
           separator: ","
       - name: Front Matter
         id: lint
         uses: hashicorp/front-matter-schema@main
         with:
           files: ${{ steps.changed-files.outputs.all_modified_files }}
           directories: |
             items
           schema: |
             {
               "properties": {
                   "title": {
                      "type": "string",
                      "required": true
                 }
               }
             }

Given Github Actions not supporting multi-dimensional inputs like hashes, I'm just passing the schema in as raw JSON. This could however be the output of another step as well.

About

Github Action for validating front matter YAML against a schema

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published