Skip to content

ci: Add github action to update openapi.json #4

ci: Add github action to update openapi.json

ci: Add github action to update openapi.json #4

name: Update openapi.json using openapi.yaml and commit result
on:
pull_request:
branches: [ "main" ]
jobs:
run_conversion:
name: Run convert_to_json.py script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
cd scripts
python -m pip install --upgrade pip
python -m pip install poetry
poetry install
- name: Conversion script
run: python scripts/convert_to_json.py openapi.yaml openapi.json
- name: Commit result
uses: stefanzweifel/git-auto-commit-action@v5
id: auto-commit-action
with:
commit_message: Update openapi.json to match openapi.yaml
- if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "Update openapi.json"
- if: steps.auto-commit-action.outputs.changes_detected == 'false'
run: echo "openapi.json is already up to date"