-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (41 loc) · 1.42 KB
/
openapi-frontend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0
name: 'OpenAPI frontend client'
on:
pull_request:
branches: [main]
jobs:
generate:
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
cache: pip
cache-dependency-path: ./backend/pyproject.toml
python-version: '3.11'
- name: Install dependencies
working-directory: ./backend
run: python -m venv .venv && .venv/bin/pip install -e ".[dev]"
- name: Run openapi-generator
run: make openapi
- name: Compare against HEAD
id: git-diff
run: git add . && git diff --cached --exit-code
- name: Post comment if client is outdated
if: always() && steps.git-diff.outcome == 'failure'
uses: actions/github-script@v7
env:
TEXT: |-
The generated OpenAPI client is not up to date with the latest changes in the OpenAPI specification.
Please run `make openapi` locally and commit the changes.
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.TEXT
})