From 7985368974ae2deed41b476551b0f818a0a2a70c Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 23 Jul 2025 13:34:59 +0200 Subject: [PATCH] Automate schema regeneration through CI --- .github/workflows/regenerate-schemas.yml | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/regenerate-schemas.yml diff --git a/.github/workflows/regenerate-schemas.yml b/.github/workflows/regenerate-schemas.yml new file mode 100644 index 00000000..1e08d8e6 --- /dev/null +++ b/.github/workflows/regenerate-schemas.yml @@ -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 +