mirror of
https://github.com/awalsh128/cache-apt-pkgs-action.git
synced 2026-08-08 18:53:33 +00:00
Add apt package list update to fix nektos/act compatibility
Co-authored-by: awalsh128 <2087466+awalsh128@users.noreply.github.com>
This commit is contained in:
parent
dde77c385e
commit
8c82e59d15
0
apt_query-x86.log
Normal file
0
apt_query-x86.log
Normal file
|
|
@ -29,6 +29,19 @@ input_packages="${@:5}"
|
||||||
|
|
||||||
# Trim commas, excess spaces, and sort.
|
# Trim commas, excess spaces, and sort.
|
||||||
log "Normalizing package list..."
|
log "Normalizing package list..."
|
||||||
|
|
||||||
|
# Ensure APT package lists are updated if stale (for nektos/act compatibility)
|
||||||
|
# Uses the same logic as install_and_cache_pkgs.sh
|
||||||
|
if [[ -z "$(find -H /var/lib/apt/lists -maxdepth 0 -mmin -5 2>/dev/null)" ]]; then
|
||||||
|
log "APT package lists are stale, updating..."
|
||||||
|
if command -v apt-fast > /dev/null 2>&1; then
|
||||||
|
sudo apt-fast update > /dev/null 2>&1 || sudo apt update > /dev/null 2>&1 || true
|
||||||
|
else
|
||||||
|
sudo apt update > /dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
log "APT package lists updated"
|
||||||
|
fi
|
||||||
|
|
||||||
packages="$(get_normalized_package_list "${input_packages}")"
|
packages="$(get_normalized_package_list "${input_packages}")"
|
||||||
log "done"
|
log "done"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue