脚本修改
Some checks failed
API接口参数变更检测 / api-param-check (push) Has been cancelled

This commit is contained in:
2026-06-03 15:33:24 +08:00
parent 6db621a137
commit 2c20a26af8
15 changed files with 136 additions and 897 deletions

View File

@@ -1,6 +1,4 @@
# Gitea Actionspush 后检测 Controller 接口参数变更
# 工具代码与配置均位于 .gitea/ 目录,与业务代码解耦
# 检出方式:使用 gitea.token 直连内网 Git 仓库(避免 actions/checkout 网络问题)
# Gitea ActionsController 接口参数变更检测(纯 Python无 Java 构建)
name: API接口参数变更检测
run-name: ${{ gitea.actor }}的API参数变更检测
@@ -9,7 +7,6 @@ on: [push]
jobs:
api-param-check:
# 排除指定分支(与现有 AI 审查 workflow 保持一致,可按需修改)
if: ${{ gitea.ref != 'refs/heads/pre' && gitea.ref != 'refs/heads/dev' && gitea.ref != 'refs/heads/master-2.0' }}
runs-on: ubuntu-latest
@@ -28,29 +25,15 @@ jobs:
echo "错误: 缺少 .gitea/config.yaml"
exit 1
fi
echo "使用 .gitea/config.yaml"
- name: 安装 Java、Maven 和 Python
- name: 安装 Python 和依赖
run: |
echo "安装运行环境..."
sudo apt-get update
sudo apt-get install -y openjdk-11-jdk maven python3 python3-pip
java -version
mvn -version
python3 --version
echo "环境准备完成"
- name: 安装 Python 依赖
run: |
sudo apt-get install -y python3 python3-pip
python3 -m pip install --break-system-packages -r .gitea/checker/requirements.txt
- name: 构建 AST 解析器
working-directory: .gitea/java-parser
run: mvn -q package -DskipTests
- name: 检测 Controller 接口参数变更
run: |
echo "执行 API 参数变更检测..."
COMMIT_TIME=$(git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
python3 .gitea/checker/main.py \
--config .gitea/config.yaml \