This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
# Gitea Actions:push 后检测 Controller 接口参数变更
|
||||
# 工具代码与配置均位于 .gitea/ 目录,与业务代码解耦
|
||||
# 检出方式:使用 gitea.token 直连内网 Git 仓库(避免 actions/checkout 网络问题)
|
||||
# Gitea Actions:Controller 接口参数变更检测(纯 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 \
|
||||
|
||||
Reference in New Issue
Block a user