Files
AI-Check-Test/.gitea/workflows/api-change-check.yml
dongzi 0600feed2e
All checks were successful
API接口参数变更检测 / api-param-check (push) Successful in 33s
py依赖修改
2026-06-03 15:40:47 +08:00

47 lines
1.6 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: |
if ! python3 -m venv .gitea/.venv 2>/dev/null; then
sudo apt-get update -qq
sudo apt-get install -y python3-venv
python3 -m venv .gitea/.venv
fi
.gitea/.venv/bin/pip install --upgrade pip
.gitea/.venv/bin/pip install -r .gitea/checker/requirements.txt
- name: 检测 Controller 接口参数变更
run: |
COMMIT_TIME=$(git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
.gitea/.venv/bin/python .gitea/checker/main.py \
--config .gitea/config.yaml \
--repo-root . \
"${{ gitea.actor }}" \
"$COMMIT_TIME"