test
Some checks failed
API Parameter Change Check / api-param-check (push) Failing after 3s

This commit is contained in:
2026-06-03 15:02:21 +08:00
parent 2eacae577c
commit 556f5b8ab6
25 changed files with 2119 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
# Gitea Actionspush 后检测 Controller 接口参数变更
# 工具代码与配置均位于 .gitea/ 目录,与业务代码解耦
name: API Parameter Change Check
on:
push:
branches:
- '**'
jobs:
api-param-check:
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 检查配置文件
run: |
if [ ! -f .gitea/config.yaml ]; then
echo "错误: 缺少 .gitea/config.yaml"
exit 1
fi
echo "使用 .gitea/config.yaml"
- name: 安装 Java 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '11'
cache: maven
- name: 安装 Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 构建 AST 解析器
working-directory: .gitea/java-parser
run: mvn -q package -DskipTests
- name: 安装 Python 依赖
run: pip install -r .gitea/checker/requirements.txt
- name: 检测 Controller 接口参数变更
run: |
python .gitea/checker/main.py \
--config .gitea/config.yaml \
--repo-root . \
"${{ gitea.actor }}" \
"$(git log -1 --format=%ci)"
- name: 上传变更日志
if: always()
uses: actions/upload-artifact@v4
with:
name: api-change-logs
path: .gitea/logs/api-changes/
if-no-files-found: ignore