fix(ci): retry the dependency install on a lagging mirror
version / print-version (push) Successful in 2s

pacman aborted the transaction because one mirror answered 404 for a
signature file, which happens while a mirror catches up with the package
database. The databases are refreshed and the install retried instead of
failing the release on the first attempt.
This commit is contained in:
BlackAngelTV committed 2026-11-27 07:44:19 +01:00
1 parent 6ebb946437
commit 704bab8af1
1 file changed
+14 -5
+14 -5
View File
@@ -44,11 +44,20 @@ jobs:
echo "All the build dependencies are already installed."
exit 0
fi
if ! sudo -n pacman -S --needed --noconfirm $missing; then
echo "::error::could not install:$missing"
echo '::error::give the runner user passwordless sudo for pacman or preinstall these packages.'
exit 1
fi
# A mirror can lag behind the package database and answer 404 for a
# signature that was just published, which aborts the whole
# transaction: refresh the databases and retry before giving up.
attempt=1
until sudo -n pacman -Syy --needed --noconfirm $missing; do
if [ "$attempt" -ge 3 ]; then
echo "::error::could not install:$missing"
echo '::error::give the runner user passwordless sudo for pacman or preinstall these packages.'
exit 1
fi
attempt=$((attempt + 1))
echo "::warning::pacman failed, retrying ($attempt/3)"
sleep 15
done
- name: Read the version file
id: version