Files
xiaoxia-saas/.gitea/workflows/code-review.yml
T
CI Bot 72e613f4b6
AI Code Review / AI Code Review (pull_request) Successful in 2m25s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m29s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 7m39s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 10m4s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 10m4s
Preview Cleanup / Cleanup Preview Environment (pull_request) Failing after 1s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 1393h52m57s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 1393h55m9s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 1393h55m11s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 1393h55m11s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 1393h55m13s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 1393h55m13s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 1393h55m13s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 1393h55m17s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 1393h55m17s
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been skipped
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 1394h27m19s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 1394h27m19s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 1394h27m21s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 1394h27m25s
fix(ci): code-review换回actions/checkout@v3(runner层处理不受容器网络影响)
2026-07-20 13:34:02 +08:00

67 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: AI Code Review
on:
pull_request:
types:
- opened
- synchronize
- reopened
# 同一个 PR 只跑一个 review,新的取消旧的
concurrency:
group: code-review-${{ gitea.repository }}-${{ gitea.event.pull_request.number }}
cancel-in-progress: true
jobs:
code-review:
name: AI Code Review
runs-on: ubuntu-latest
# 跳过草稿 PR
if: ${{ !gitea.event.pull_request.draft }}
steps:
# actions/checkout 由 runner 在宿主机层面处理,不受容器网络影响
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install requests
- name: Run AI Code Review
env:
# Gitea 配置(自动从运行环境获取)
GITEA_API_URL: ${{ gitea.server_url }}
GITEA_TOKEN: ${{ secrets.REVIEW_GITEA_TOKEN }}
REPO_NAME: ${{ gitea.repository }}
PR_NUMBER: ${{ gitea.event.pull_request.number }}
# LLM 提供商: coze (扣子原生Bot) / openai (OpenAI兼容)
LLM_PROVIDER: "coze"
# 扣子模式配置(默认国内站 api.coze.cn)
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
COZE_BOT_ID: ${{ secrets.COZE_BOT_ID }}
LLM_MODEL: ${{ secrets.LLM_MODEL }}
# 可选参数
MAX_DIFF_CHARS: "30000"
LLM_TIMEOUT: "120"
run: |
python3 scripts/ci_code_review.py
# 审查脚本异常不影响 CI 通过
continue-on-error: true
- name: Report CI trace
if: always()
shell: sh
env:
AGENTLOOP_LICENSE_KEY: ${{ secrets.AGENTLOOP_LICENSE_KEY }}
run: |
STATUS="ok"
[ ${{ job.status }} = "success" ] || STATUS="error"
START_TIME=""
[ -f /tmp/ci_job_start_time ] && START_TIME=$(cat /tmp/ci_job_start_time)
python3 scripts/ci/ci_trace_report.py --service xiaoxia-saas-ci --status $STATUS --start-time "$START_TIME" || true