Files
demo-workflow-repo/.gitea/workflows/code-review.yml

23 lines
924 B
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 comment)
on:
issue_comment:
types: [created, edited]
jobs:
review:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && (startsWith(github.event.comment.body, 'openai') || github.event.comment.body == 'openai')
env:
ACTIONS_STEP_DEBUG: 'true' # 可选,便于查看调试日志
steps:
- name: OpenAI Code Review
uses: ingress-it-solutions/gitea-code-review-action@v0.1
with:
SOURCE_AT: gitea
GITHUB_BASE_URL: https://devstar.cn # 若有子路径/端口,请改成真实根地址
PROGRAMMING_LANGUAGE: 'JavaScript' # 避免使用 auto
FULL_REVIEW_COMMENT: openai
REVIEW_COMMENT_PREFIX: 'openai:'
MAX_CODE_LENGTH: 6000
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # 需为 Gitea PAT具备对 PR/Issue 评论权限