更新 .gitea/workflows/code-review.yml

This commit is contained in:
2025-08-19 10:45:27 +00:00
parent c1c5f53c86
commit 51a237e275

View File

@@ -31,7 +31,16 @@ jobs:
-d '{"body":"healthcheck from workflow"}' \ -d '{"body":"healthcheck from workflow"}' \
"$BASE/api/v1/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments" >/dev/null "$BASE/api/v1/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments" >/dev/null
echo "comment endpoint OK" echo "comment endpoint OK"
- name: Preflight - OpenAI 连接
env:
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
# 可直连 OpenAI 则删除本行;需代理则改成你的代理地址,如 http://127.0.0.1:7890
# OPENAI_PROXY: http://your-proxy:port
run: |
set -e
curl -sS -i ${OPENAI_PROXY:+--proxy $OPENAI_PROXY} \
-H "Authorization: Bearer $OPENAI_TOKEN" \
https://api.openai.com/v1/models | head -n 1
- name: OpenAI Code Review - name: OpenAI Code Review
uses: ingress-it-solutions/gitea-code-review-action@v0.1 uses: ingress-it-solutions/gitea-code-review-action@v0.1
env: env:
@@ -44,5 +53,5 @@ jobs:
FULL_REVIEW_COMMENT: openai FULL_REVIEW_COMMENT: openai
REVIEW_COMMENT_PREFIX: 'openai:' REVIEW_COMMENT_PREFIX: 'openai:'
MAX_CODE_LENGTH: 6000 MAX_CODE_LENGTH: 6000
OPENAI_TOKEN: sk-zk2d9d33dbd6a23ba9f1c90886f9451903668a44e780940e OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}