Skip to content

Automatically detect missing updates to OpenAPI specs and client #6

Automatically detect missing updates to OpenAPI specs and client

Automatically detect missing updates to OpenAPI specs and client #6

name: OpenAPI
on:
pull_request:
paths:
- 'server/application-server/**'
- '.github/workflows/generate-api-client.yml'
workflow_dispatch:
jobs:
generate-api-client:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Install dependencies
run: npm install
- name: Pull latest changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git pull --rebase origin ${{ github.event.pull_request.head.ref }}
- name: Generate API client
run: npm run generate:api
- name: Commit and push changes
run: |
git add webapp/src/app/core/modules/openapi
git diff-index --quiet HEAD || git commit -m "chore: update API client"
git push origin HEAD:${{ github.event.pull_request.head.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}