Skip to content

Commit e40b6da

Browse files
committed
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.
1 parent a9fc9a1 commit e40b6da

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎.github/workflows/linux.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ jobs:
129129
# Drop archives for versions the index no longer offers so the cache cannot grow.
130130
sudo apt-get autoclean -q
131131
rm -f ~/apt-archives/*.deb
132-
cp /var/cache/apt/archives/*.deb ~/apt-archives/
132+
# The compgen guard: an unmatched glob stays literal and fails cp under
133+
# `set -e`, as it would when the runner image already has every package.
134+
if compgen -G "/var/cache/apt/archives/*.deb" > /dev/null; then
135+
cp /var/cache/apt/archives/*.deb ~/apt-archives/
136+
fi
133137
134138
- name: Save Linux desktop package archives
135139
if: steps.impact.outputs.run != 'false' && steps.apt-archives.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)