-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (42 loc) · 1.35 KB
/
generated.yml
File metadata and controls
46 lines (42 loc) · 1.35 KB
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
45
46
name: Generated code check
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
staleness:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: ./.github/actions/setup-uv
- run: uv sync --group regen
- name: Prepare spec
run: |
set -euo pipefail
if [[ -f openapi-overlay.yaml ]]; then
uv run oas-patch overlay openapi.json openapi-overlay.yaml -o /tmp/patched-spec.json
else
cp openapi.json /tmp/patched-spec.json
fi
- name: Regenerate client
run: |
uv run openapi-python-client generate \
--path /tmp/patched-spec.json \
--meta none \
--config openapi-python-client-config.yaml \
--custom-template-path custom-templates \
--output-path ionq_core \
--overwrite
- name: Check for uncommitted changes
run: |
if [[ -n "$(git status --porcelain ionq_core/)" ]]; then
echo "::error::Generated code is out of date. Run the generator and commit the results."
git diff ionq_core/
exit 1
fi