Skip to content

Commit

Permalink
chore(schemas): fix schema build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kashalls committed Aug 13, 2024
1 parent 301616e commit 3ab6196
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 35 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/build-schema.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "Build schema and push back to repository"

'on':
push:
branches:
- main

jobs:
build-schema:
name: Build schema
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.5

- name: Render schema
run: |
go mod tidy
go run main.go -jsonschema > config.schema.json
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
commit_message: "docs: render JSON Schema"
file_pattern: "config.schema.json"
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: "YAML Schema"
on:
push:
branches: ['main']

jobs:
build-schema:
name: Build YAML Schema
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.5

- name: Render schema
run: |
go mod tidy
go run cmd/kromgo/main.go -jsonschema > config.schema.json
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
with:
commit_message: "docs: render json schema"
file_pattern: "config.schema.json"

3 changes: 1 addition & 2 deletions cmd/kromgo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ var (
)

func main() {
fmt.Printf(banner, Version, Gitsha)

configPathFlag := flag.String("config", "", "Path to the YAML config file")
jsonSchemaFlag := flag.Bool("jsonschema", false, "Dump JSON Schema for config file")
flag.Parse()
Expand All @@ -38,6 +36,7 @@ func main() {
return
}

fmt.Printf(banner, Version, Gitsha)
log.Init()

config := configuration.Init(*configPathFlag)
Expand Down

0 comments on commit 3ab6196

Please sign in to comment.