23 lines
887 B
YAML
23 lines
887 B
YAML
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')
|
||
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
|
||
# v0.1 存在 auto 的赋值与变量作用域问题,建议先用显式语言
|
||
PROGRAMMING_LANGUAGE: 'JavaScript'
|
||
FULL_REVIEW_COMMENT: openai
|
||
REVIEW_COMMENT_PREFIX: 'openai:'
|
||
MAX_CODE_LENGTH: 6000
|
||
OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }}
|
||
# 这里必须是 Gitea 的 PAT(可读 PR、可在 Issue/PR 评论)
|
||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |