Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/github-schema-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: '.github schema check'

on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/dependabot.yml'
- '.github/actions/*/action.yml'
- '.github/workflows/*.yml'
pull_request:
paths:
- '.github/dependabot.yml'
- '.github/actions/*/action.yml'
- '.github/workflows/*.yml'

jobs:
github-schemas:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 1

- name: '.github/dependabot.yml'
if: ${{ hashFiles('.github/dependabot.yml') != '' }}
uses: cardinalby/schema-validator-action@v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, but I'd prefer to have a command line script one could run locally, instead of having an extra third party dependency (on the action) and needing to push to GH for the validation to work.

with:
file: '.github/dependabot.yml'
schema: 'https://json.schemastore.org/dependabot-2.0.json'
mode: 'lax' # We really just want allowUnusedKeywords: true

- name: '.github/actions'
if: ${{ hashFiles('.github/actions/*/action.yml') != '' }}
uses: cardinalby/schema-validator-action@v3
with:
file: '.github/actions/*/action.yml'
schema: 'https://json.schemastore.org/github-action.json'

- name: '.github/workflows'
if: ${{ hashFiles('.github/workflows/*.yml') != '' }}
uses: cardinalby/schema-validator-action@v3
with:
file: '.github/workflows/*.yml'
schema: 'https://json.schemastore.org/github-workflow.json'
mode: 'lax' # https://github.com/SchemaStore/schemastore/issues/3102