fix(ci): code-review镜像pip兼容,多路径兜底确保pip可用

This commit is contained in:
2026-07-20 18:50:18 +08:00
parent 419cc3fb6a
commit afc8d0adf9
+8
View File
@@ -28,6 +28,14 @@ jobs:
- name: Install dependencies
run: |
# 确保 python3-pip 可用(兼容不同基础镜像)
if ! python3 -m pip --version >/dev/null 2>&1; then
apt-get update -qq && apt-get install -y -qq python3-pip python3-venv >/dev/null 2>&1
fi
# 部分镜像 ensurepip 方式兜底
if ! python3 -m pip --version >/dev/null 2>&1; then
python3 -m ensurepip --upgrade 2>/dev/null || curl -sS https://bootstrap.pypa.io/get-pip.py | python3
fi
python3 -m pip install --upgrade pip
python3 -m pip install requests