Compare commits
1 Commits
main
...
james-patc
Author | SHA1 | Date | |
---|---|---|---|
3eb89c2399 |
@ -1,30 +1,41 @@
|
|||||||
name: Run Unit Tests
|
name: Run Unit Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- develop
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths-ignore:
|
|
||||||
- '.gitea/**'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: phpunit_test
|
runs-on: phpunit_test
|
||||||
container: docker.xuanyuan.me/xeden3/ai-code-reviewer-gitea-runner:v1.2
|
container: docker.xuanyuan.me/hui369/sctmes-v5-runner:v3.0
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code2
|
- name: Checkout code
|
||||||
uses: http://119.91.43.128:3003/james/checkout@v4
|
uses: http://119.91.43.128:3003/james/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 2 # 至少获取最近两次提交
|
|
||||||
|
|
||||||
- name: Run code review script
|
- name: Run code review script
|
||||||
env:
|
env:
|
||||||
GIT_PROJECT_PATH: /workspace/hui/SCTMES_V5 # Gitea 的工作目录
|
GIT_PROJECT_PATH: /workspace/MES/SCTMES_V5 # Gitea 的工作目录
|
||||||
|
ALLOWED_PATHS: '["EdgeManager/**", "mes_in_sct/**", "mes_in_task/**", "webman/**"]' # 允许检测目录
|
||||||
|
IGNORED_PATHS: '["EdgeManager/vendor/**", "mes_in_sct/vendor/**", "mes_in_task/vendor/**", "webman/public/**", "webman/runtime/**", "webman/vendor/**"]' # 忽略检测目录
|
||||||
|
SYSTEM_PROMPT: |
|
||||||
|
你是代码审核助手,我需要你审核代码后以JSON形式输出通过(passed)或者不通过(no-passed),只输出json不添加其他说明。
|
||||||
|
只判断代码是否存在变量拼写错误,并且在issues输出行数、出错语句及原因;
|
||||||
|
忽略其他错误,包括代码安全、SQL 语句内的错误、未定义的变量错误、未定义的方法错误、函数未定义错误、未定义的函数错误、PHP内置函数错误等;
|
||||||
|
最终输出一定遵守以下JSON格式,不允许出现其他格式:
|
||||||
|
|
||||||
|
{
|
||||||
|
"status": "no-passed",
|
||||||
|
"issues": [
|
||||||
|
{
|
||||||
|
"line": 105,
|
||||||
|
"reason": "变量命名xxx不符合规范"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
如果没有发现相关问题,请一定输出以下JSON格式:
|
||||||
|
{"status": "passed"}
|
||||||
run: |
|
run: |
|
||||||
cd /workspace
|
cd /workspace
|
||||||
./audit_code.sh
|
./audit_code.sh
|
Loading…
x
Reference in New Issue
Block a user