ci: update PR workflow to bun-based checks
This commit is contained in:
@@ -1,76 +1,33 @@
|
|||||||
name: oc review
|
name: pr checks
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
types: [opened, synchronize, reopened, ready_for_review]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
review:
|
checks:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
issues: read
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
node-version: '20'
|
||||||
|
|
||||||
- name: OpenCode PR review
|
- name: Install dependencies
|
||||||
uses: anomalyco/opencode/github@latest
|
run: bun install --frozen-lockfile
|
||||||
env:
|
|
||||||
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
model: opencode/gpt-5.2-codex
|
|
||||||
use_github_token: true
|
|
||||||
prompt: |
|
|
||||||
Review this pull request.
|
|
||||||
|
|
||||||
Output rules:
|
- name: Build
|
||||||
- Start with a 1-2 sentence summary.
|
run: bun run build
|
||||||
- Write a single concise PR comment.
|
|
||||||
- No emojis. No code snippets. No fenced blocks.
|
|
||||||
- Short inline code identifiers allowed, but no snippets or fenced blocks.
|
|
||||||
- Reference evidence with file paths and line ranges (e.g., path/to/file.ts:120-138).
|
|
||||||
- Keep the entire comment under ~300 words.
|
|
||||||
|
|
||||||
Report:
|
- name: Type check
|
||||||
- Must-fix issues (blocking) — brief why and a one-line action each.
|
run: bun run type-check
|
||||||
- Nice-to-have improvements (optional) — brief why and a one-line action each.
|
|
||||||
|
|
||||||
Applicability and runtime coverage:
|
- name: Lint
|
||||||
- Explicitly state applicability across Web / Desktop (Tauri) / VS Code.
|
run: bun run lint
|
||||||
- If a runtime is not affected, say: “<Runtime>: not applicable — <reason>”.
|
|
||||||
- Remember: backends are separate implementations; Desktop (Tauri) does not reuse Web.
|
|
||||||
- VS Code extension does not require 100% feature parity; many features are intentionally hidden — justify parity expectations.
|
|
||||||
|
|
||||||
Code standards (AGENTS.md):
|
|
||||||
- TypeScript: no `any`, avoid blind casts; prefer precise types and generics.
|
|
||||||
- React: function components + hooks; avoid class components and side-effects outside hooks.
|
|
||||||
- Control flow: no nested ternaries; prefer early returns and readable branching.
|
|
||||||
- Styling: Tailwind v4; use typography.ts and theme variables; avoid ad-hoc inline styles unless justified.
|
|
||||||
- Monorepo: tight diffs; follow local precedent in the touched package/module.
|
|
||||||
- Dependencies: avoid new deps unless justified; if introduced, provide rationale and a standard-library or existing-deps alternative.
|
|
||||||
|
|
||||||
Architecture:
|
|
||||||
- Call out breakages, missing implementations across runtimes/modules, or boundary violations.
|
|
||||||
- Note cross-cutting concerns (errors, logging, accessibility) if missing.
|
|
||||||
|
|
||||||
Precedence:
|
|
||||||
- If local precedent conflicts with global standards, state the deviation explicitly and recommend alignment or a follow-up RFC.
|
|
||||||
|
|
||||||
Format exactly:
|
|
||||||
Must-fix:
|
|
||||||
- <issue> — <brief why> — <file:line-range> — Action: <one-line action>
|
|
||||||
Nice-to-have:
|
|
||||||
- <issue> — <brief why> — <file:line-range> — Action: <one-line action>
|
|
||||||
If no issues, write:
|
|
||||||
Must-fix:
|
|
||||||
- None
|
|
||||||
Nice-to-have:
|
|
||||||
- None
|
|
||||||
|
|||||||
Reference in New Issue
Block a user