Files
AI-Check-Test/.gitea/workflows/api-change-check.yml
dongzi 2c20a26af8
Some checks failed
API接口参数变更检测 / api-param-check (push) Has been cancelled
脚本修改
2026-06-03 15:33:24 +08:00

43 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Gitea ActionsController 接口参数变更检测(纯 Python无 Java 构建)
name: API接口参数变更检测
run-name: ${{ gitea.actor }}的API参数变更检测
on: [push]
jobs:
api-param-check:
if: ${{ gitea.ref != 'refs/heads/pre' && gitea.ref != 'refs/heads/dev' && gitea.ref != 'refs/heads/master-2.0' }}
runs-on: ubuntu-latest
steps:
- name: 内置权限检出代码
run: |
git config --global http.sslVerify false
git clone "https://${{ gitea.token }}@git.niujiekeji.com/${{ gitea.repository }}.git" .
git checkout ${{ gitea.sha }}
echo "当前提交: $(git rev-parse HEAD)"
echo "上一提交: $(git rev-parse HEAD~1 2>/dev/null || echo '无')"
- name: 检查配置文件
run: |
if [ ! -f .gitea/config.yaml ]; then
echo "错误: 缺少 .gitea/config.yaml"
exit 1
fi
- name: 安装 Python 和依赖
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip
python3 -m pip install --break-system-packages -r .gitea/checker/requirements.txt
- name: 检测 Controller 接口参数变更
run: |
COMMIT_TIME=$(git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
python3 .gitea/checker/main.py \
--config .gitea/config.yaml \
--repo-root . \
"${{ gitea.actor }}" \
"$COMMIT_TIME"