Skip to content

Commit

Permalink
add schema
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin committed Oct 31, 2024
1 parent 7b0fedb commit b08f282
Show file tree
Hide file tree
Showing 5 changed files with 1,315 additions and 1 deletion.
27 changes: 26 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ on:
pull_request:
types: [opened, synchronize, reopened]

env:
helm: v3.16.2

jobs:
docs:
runs-on: ubuntu-latest
name: Helm docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -23,3 +26,25 @@ jobs:
echo "::error::Changes waiting. Please run 'helm-docs' prior to your next commit."
exit -1
fi
schema:
name: Generate schema file
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: ${{ env.helm }}

- name: Generate schema file
uses: losisin/helm-values-schema-json-action@v1
with:
input: charts/monica/values.yaml
output: charts/monica/values.schema.json
indent: 2
fail-on-diff: true
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ repos:
rev: v1.14.2
hooks:
- id: helm-docs

- repo: https://github.com/losisin/helm-values-schema-json
rev: v1.6.1
hooks:
- id: helm-schema
args: ["-input", "charts/monica/values.yaml", "-output", "charts/monica/values.schema.json", "-indent", "2"]
11 changes: 11 additions & 0 deletions .schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Required
input:
- charts/monica/values.yaml

indent: 2
output: charts/monica/values.schema.json

schemaRoot:
id: https://example.com/schema
title: Monica Helm Charts Values Schema
description: Schema for Helm values
Loading

0 comments on commit b08f282

Please sign in to comment.