Supports four types of operations using AI: code review, PR title and description readability check, commit message readability check, and change summary.
Note: Results are for reference only and are not recommended as final criteria.
cnbcool/ai-review
type: Operation type, default is code-review
code-review: Code reviewpr-info-readability-check: PR title and description readability checkcommit-message-readability-check: Commit message readability checkdiff-summary: Change summarymessage: When type=commit-message-readability-check, you can specify the message parameter to indicate the commit
message. If not specified, it defaults to CNB_COMMIT_MESSAGEpr_comment: true or false, default is true. Whether to post PR comments as pull_request inline comments
(currently only supports sending one comment). Valid when type=code-reviewmax_comments: Maximum number of comments, default is 10, maximum is 10. Valid when type=code-reviewprompt_output_file: Optional, relative file path, such as ./prompt.txt. If provided, the prompt will be saved to
the file.result_output_file: Optional, relative file path, such as ./result.txt. If provided, the AI output result will be saved to the file.score_for_add_comment: Optional, when type=code-review and pr_comment is true, you can specify this parameter to indicate the comment score threshold. Reviews below this score will be commented on the PR.pr-info-readability-check: Outputs environment variable name status, value is yes or nocommit-message-readability-check: Outputs environment variable name status, value is yes or nodiff-summary: Outputs environment variable name summary, indicating the content of the change summaryBy default, AI review comments will be sent as comments to the PR. Currently only supports sending one comment.
main:
pull_request:
- stages:
- name: Code Review
image: cnbcool/ai-review:latest
settings:
type: code-review
main:
pull_request:
- stages:
- name: Title and Description Readability Check
image: cnbcool/ai-review:latest
settings:
type: pr-info-readability-check
exports:
status: STATUS
- name: Title and Description Readability Check Result
script: echo $STATUS
main:
push:
- stages:
- name: Commit Message Readability Check
image: cnbcool/ai-review:latest
settings:
type: commit-message-readability-check
exports:
status: STATUS
- name: Commit Message Readability Check Result
script: echo $STATUS
main:
pull_request:
- stages:
- name: Change Summary
image: cnbcool/ai-review:latest
settings:
type: diff-summary
exports:
summary: SUMMARY
- name: Change Summary
script: echo $SUMMARY