diff --git a/.gitea/workflows/code-review.yml b/.gitea/workflows/code-review.yml index 2e5f913..8426a4c 100644 --- a/.gitea/workflows/code-review.yml +++ b/.gitea/workflows/code-review.yml @@ -1,13 +1,23 @@ -- name: OpenAI Code Review - uses: ingress-it-solutions/gitea-code-review-action@v0.1 - env: - OPENAI_PROXY: https://api.zhizengzeng.com/v1 # 或 https://... - with: - SOURCE_AT: gitea - GITHUB_BASE_URL: https://devstar.cn - PROGRAMMING_LANGUAGE: 'JavaScript' - FULL_REVIEW_COMMENT: openai - REVIEW_COMMENT_PREFIX: 'openai:' - MAX_CODE_LENGTH: 6000 - OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} \ No newline at end of file +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 + env: + OPENAI_PROXY: https://api.zhizengzeng.com/v1 + with: + SOURCE_AT: gitea + GITHUB_BASE_URL: https://devstar.cn + PROGRAMMING_LANGUAGE: 'JavaScript' + FULL_REVIEW_COMMENT: openai + REVIEW_COMMENT_PREFIX: 'openai:' + MAX_CODE_LENGTH: 6000 + OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} \ No newline at end of file