Skip to content

Commit d75737c

Browse files
snomiaoCopilot
andauthored
Update OpenAPI (#102)
* chore(api-gen): update cron schedule to run daily at midnight UTC for API type definitions chore(api-gen): refactor workflow steps to use bun for dependency management and API definition update chore(package): update orval dependency to version 7.9.0 for improved features and fixes refactor(orval.config.ts): adjust dotenv loading logic to be compatible with bun environment * chore: update lockfile * chore(package.json): update orval command to use bunx for better compatibility with package management * chore: generate backend API static type * Update orval.config.ts Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 6afd1f0 commit d75737c

File tree

6 files changed

+10366
-7728
lines changed

6 files changed

+10366
-7728
lines changed

.github/workflows/api-gen.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,40 @@ on:
44
push:
55
branches: [sno-api-gen]
66
schedule:
7-
- cron: '0 2 1,15 * *'
7+
# Every day at midnight UTC, update the API type definitions from staging backend
8+
- cron: '0 0 * * *'
89
workflow_dispatch:
910

1011
permissions:
1112
contents: write
1213
pull-requests: write
1314

1415
jobs:
15-
update-browserslist-database:
16+
orval:
1617
runs-on: ubuntu-latest
1718
steps:
1819
- name: Checkout repository
1920
uses: actions/checkout@v3
2021
with:
2122
fetch-depth: 0
23+
# Set up Node.js environment
24+
- name: Set up Node.js
25+
uses: actions/setup-node@v2
26+
with:
27+
node-version: '22'
28+
- name: Install bun
29+
run: npm install -g bun
30+
- name: Install dependencies
31+
run: bun i
32+
- name: Update api definition
33+
run: bun orval
34+
35+
# commit generated api
2236
- name: Configure git
2337
run: |
2438
# Setup for commiting using built-in token. See https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
2539
git config user.name "github-actions[bot]"
2640
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
27-
- name: Set up Node.js
28-
uses: actions/setup-node@v2
29-
with:
30-
node-version: '22'
31-
- name: update api definition
32-
run: npx -y orval
33-
# commit prettier fixed code
3441
- uses: stefanzweifel/git-auto-commit-action@v5
3542
with:
3643
commit_message: 'chore: generate backend API static type'

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,3 @@ yarn.lock
6060
# ignore storybook files
6161
storybook-static
6262
*storybook.log
63-
64-
#

0 commit comments

Comments
 (0)