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

Update cr.yml #8

Open
wants to merge 1 commit into
base: yanghua-patch-5
Choose a base branch
from
Open

Update cr.yml #8

wants to merge 1 commit into from

Conversation

yanghua
Copy link

@yanghua yanghua commented Apr 13, 2023

Why are the changes needed?

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

@@ -10,7 +10,8 @@ on:

jobs:
test:
if: ${{ contains(github.event.*.labels.*.name, 'gpt review') }} # Optional; to run only when a label is attached
# Optional; to run only when a label is attached
# if: ${{ contains(github.event.*.labels.*.name, 'gpt review') }}
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是一段通过 GitHub Action 运行 ChatGPT 代码审查的代码片段。下面是我对这段代码的简要评估:

  • 第 10 行和第 11 行之间的 if 语句被注释掉了,所以在运行时无论标签是否附加都会运行。
  • 此处没有检查代码库中的 github.event 值是否存在,如果不存在,则会导致错误.
  • 没有任何风险也没有明显的优化建议。

因此,如果您希望仅在附加了“gpt review”标签时才运行测试作业,则需要取消注释第 11 行并引入一个条件语句以判断github.event值是否存在,并根据需要做出相应的更改。

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

Successfully merging this pull request may close these issues.

1 participant