Skip to content

Commit 3c8483a

Browse files
fix: fix OpenAPI Spec Diff (#4)
1 parent c278684 commit 3c8483a

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/openapi-spec.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ on:
44
pull_request:
55
types: [ opened, synchronize, reopened, ready_for_review ]
66
branches:
7-
- master
7+
- main
88
paths:
99
- "src/api/**"
10-
- "src/schemas"
10+
- "src/schemas.py"
1111
- ".github/workflows/openapi-spec.yml"
1212
jobs:
1313
generate-openapi:
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
1418
runs-on: ubuntu-latest
1519
env:
1620
ENV_FILE: .env
@@ -45,7 +49,7 @@ jobs:
4549
4650
- name: Generate OpenAPI spec
4751
run: |
48-
uv run python tools/generate_openapi.py
52+
PYTHONPATH=src uv run python scripts/generate_openapi.py
4953
5054
- name: Upload OpenAPI spec as artifact
5155
uses: actions/upload-artifact@v4
@@ -72,8 +76,8 @@ jobs:
7276
git checkout origin/${{ github.base_ref }}
7377
# TODO: the script is not on master yet, so we generate the spec directly here.
7478
# Once the script is merged, we can use it here as well.
75-
uv run python -c "
76-
from surgical_guide_service.main import app
79+
PYTHONPATH=src uv run python -c "
80+
from main import app
7781
import json
7882
with open('openapi.json', 'w') as f:
7983
json.dump(app.openapi(), f, indent=2)
@@ -84,7 +88,7 @@ jobs:
8488
run: |
8589
git fetch
8690
git checkout ${{ github.head_ref }}
87-
uv run python tools/generate_openapi.py
91+
PYTHONPATH=src uv run python scripts/generate_openapi.py
8892
8993
- name: Generate diff
9094
run: |

src/to_be_removed.py

Whitespace-only changes.

0 commit comments

Comments
 (0)