Skip to content

Commit

Permalink
Automatically detect missing updates to OpenAPI specs and client (#15)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
FelixTJDietrich and github-actions[bot] authored Aug 1, 2024
1 parent 3b88ced commit 1111df3
Show file tree
Hide file tree
Showing 14 changed files with 1,849 additions and 147 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/generate-api-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: OpenAPI

on:
pull_request:
paths:
- 'server/application-server/**'
- '.github/workflows/generate-api-client.yml'
push:
paths:
- 'server/application-server/openapi.yaml'
- 'webapp/src/app/core/modules/openapi/**'
workflow_dispatch:

concurrency:
group: generate-api-client
cancel-in-progress: true

jobs:
generate-api-client:
name: Verify API Specs and Client
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- 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: Generate API client
run: npm run generate:api

- name: Check for changes in the API
id: check_changes
run: |
echo "Checking for changes in the API client directory..."
git add .
if git diff --cached --quiet; then
echo "No changes detected in the API client directory."
echo "NO_CHANGES_DETECTED=true" >> $GITHUB_ENV
else
echo "Changes detected in the API client directory."
echo "NO_CHANGES_DETECTED=false" >> $GITHUB_ENV
exit 1
fi
Loading

0 comments on commit 1111df3

Please sign in to comment.