Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add code review job by chatgpt #1784

Merged
merged 1 commit into from
Mar 24, 2023
Merged

feat: add code review job by chatgpt #1784

merged 1 commit into from
Mar 24, 2023

Conversation

LeoYuan
Copy link
Contributor

@LeoYuan LeoYuan commented Mar 24, 2023

No description provided.

@github-actions
Copy link

ChatGPT Code Review:

Code Review Feedback:

  1. 建议在代码中添加注释或者说明,以方便其他开发者理解代码的作用和目的。
  2. 建议添加更多的错误处理机制和日志记录,以增加代码的健壮性和可维护性。

修改建议:

  1. 在代码中添加注释或者说明。

例如:

# 这是一个使用 ChatGPT 自动审查 Pull Request 的 Github Actions 工作流文件。
# 当 Pull Request 被打开、同步或重新打开时,代码审查任务将被自动触发。
  1. 添加错误处理机制和日志记录。

例如:

- name: 'Check User Permission'
  uses: 'lannonbr/repo-permission-check-action@2.0.0'
  with:
    permission: 'write'
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  continue-on-error: true
  # 增加错误处理
  - name: Error Handling
    run: |
      echo "::error::User permission check action failed!"
      exit 1

- uses: opensumi/actions/.github/actions/code-review@main
  env:
    OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  continue-on-error: true
  # 增加错误处理和日志记录
  - name: Code Review
    if: always()
    run: |
      if [ "${{ job.status }}" == "failure" ]; then
        echo "::error::Code review failed! Check the Github Actions logs for more details."
      fi

生成的合适的 commit message:
feat: add auto code review workflow with ChatGPT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants