chore: add GitHub Actions workflow to automate OpenAPI types generation#44
chore: add GitHub Actions workflow to automate OpenAPI types generation#44karamouche wants to merge 1 commit into
Conversation
|
Warning Review limit reached
Next review available in: 56 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a GitHub Actions workflow that runs daily or manually, regenerates OpenAPI types using Bun, and opens a pull request against ChangesOpenAPI Type Update Automation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ee45f84 to
cd6deb6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/update-openapi-types.yml (1)
23-25: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winPin the Bun version used for generation.
Using
bun-version: latestmakes daily output depend on an uncontrolled toolchain change, which can create unrelated type diffs or break generation. Use an exact version or a committed version file instead. (github.com)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/update-openapi-types.yml around lines 23 - 25, Update the setup-bun step in the OpenAPI generation workflow to replace bun-version: latest with a deterministic exact Bun version or a committed version-file reference, ensuring generated types use a stable toolchain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/update-openapi-types.yml:
- Around line 21-40: Add persist-credentials: false to the actions/checkout@v7
step so the checkout token is not retained for subsequent repository scripts or
dependencies. Leave the remaining workflow steps unchanged.
---
Nitpick comments:
In @.github/workflows/update-openapi-types.yml:
- Around line 23-25: Update the setup-bun step in the OpenAPI generation
workflow to replace bun-version: latest with a deterministic exact Bun version
or a committed version-file reference, ensuring generated types use a stable
toolchain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2c2fe20d-bda8-4958-b6f7-7e7e3383d165
📒 Files selected for processing (1)
.github/workflows/update-openapi-types.yml
| - uses: actions/checkout@v7 | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: 22 | ||
| package-manager-cache: false | ||
| - run: bun install | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| - name: Install Python deps | ||
| run: bun nx run-many -t sync | ||
|
|
||
| - name: Generate OpenAPI types | ||
| run: bun nx run generator:generate |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n== workflow ==\n'
git ls-files '.github/workflows/update-openapi-types.yml'
wc -l .github/workflows/update-openapi-types.yml
sed -n '1,120p' .github/workflows/update-openapi-types.yml
printf '\n== checkout usage in repo ==\n'
rg -n "actions/checkout@v[0-9]+|persist-credentials" .github/workflows .github -S
printf '\n== nearby permissions/context ==\n'
rg -n "contents:\s*write|pull_request|workflow_dispatch|permissions:" .github/workflows/update-openapi-types.yml .github/workflows -n -SRepository: gladiaio/sdk
Length of output: 1947
Disable persisted checkout credentials. Add persist-credentials: false to actions/checkout; this job runs repository code with contents: write, so the default token should not be left available to scripts or dependencies.
🧰 Tools
🪛 zizmor (1.26.1)
[warning] 21-21: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/update-openapi-types.yml around lines 21 - 40, Add
persist-credentials: false to the actions/checkout@v7 step so the checkout token
is not retained for subsequent repository scripts or dependencies. Leave the
remaining workflow steps unchanged.
Source: Linters/SAST tools
Summary
https://api.gladia.io/openapi.jsonegenthon-cmdwhen types differTest plan
workflow_dispatchSummary by CodeRabbit