From e40b6da09c6c182798f5322fcecfc4e8e7dacaf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sat, 24 Oct 2026 09:17:11 +0200 Subject: [PATCH] ci: guard the .deb archive copy against an empty apt cache An unmatched glob stays literal, so cp fails under set -e when /var/cache/apt/archives holds no .deb. That happens when the runner image already ships every package and nothing is downloaded. Guard the copy with compgen so the step skips it instead of failing. --- .github/workflows/linux.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index cd8384b586..12f33eed8f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -129,7 +129,11 @@ jobs: # Drop archives for versions the index no longer offers so the cache cannot grow. sudo apt-get autoclean -q rm -f ~/apt-archives/*.deb - cp /var/cache/apt/archives/*.deb ~/apt-archives/ + # The compgen guard: an unmatched glob stays literal and fails cp under + # `set -e`, as it would when the runner image already has every package. + if compgen -G "/var/cache/apt/archives/*.deb" > /dev/null; then + cp /var/cache/apt/archives/*.deb ~/apt-archives/ + fi - name: Save Linux desktop package archives if: steps.impact.outputs.run != 'false' && steps.apt-archives.outputs.cache-hit != 'true'