From b69b8902d760932251c9aa8596294f391b215417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=99=BD=E5=8F=94?= <11794527+absfan@user.noreply.gitee.com> Date: Mon, 9 Nov 2026 10:13:00 +0800 Subject: [PATCH] ci: fall back to a reachable Debian mirror after CDN failure --- .gitea/workflows/ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 7e1b9c5..2d900b7 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -27,7 +27,13 @@ jobs: [ -f "$apt_source" ] || continue sed -i 's|http://deb.debian.org|https://deb.debian.org|g' "$apt_source" done - apt-get -o Acquire::Retries=2 -o APT::Update::Error-Mode=any update + if ! apt-get -o Acquire::Retries=2 -o APT::Update::Error-Mode=any update; then + for apt_source in /etc/apt/sources.list /etc/apt/sources.list.d/*.sources; do + [ -f "$apt_source" ] || continue + sed -i 's|https://deb.debian.org|https://mirrors.ustc.edu.cn|g' "$apt_source" + done + apt-get -o Acquire::Retries=2 -o APT::Update::Error-Mode=any update + fi DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=2 install -y --no-install-recommends python3 python3-pytest python3-openpyxl python3 --version - name: Compile application and build helpers