目录del
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
# Gitea Actions:Controller 接口参数变更检测(纯 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"
|
||||
Reference in New Issue
Block a user