Browse Source

Automate schema regeneration through CI

pull/1083/head
Philipp Oppermann 6 months ago
parent
commit
7985368974
Failed to extract signature
1 changed files with 29 additions and 0 deletions
  1. +29
    -0
      .github/workflows/regenerate-schemas.yml

+ 29
- 0
.github/workflows/regenerate-schemas.yml View File

@@ -0,0 +1,29 @@
name: Regenerate JSON schemas

on:
push:
branches: ["main"]

jobs:
regenerate_schemas:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4

- name: Update Schema
run: cargo run -p dora-core --bin generate_schema
- name: Create if changed
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if git diff --exit-code -- libraries/core/dora-schema.json; then
echo "Schema file was not changed"
else
git switch -c schema-update-for-${{ github.sha }}
git add libraries/core/dora-schema.json
git commit -m "Update JSON schema for `dora-core`"
gh pr create --fill
fi

Loading…
Cancel
Save