From c6f35c51f3de3eda212ff78ac23a7b3bfb06de78 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Tue, 2 Jun 2026 23:19:46 +0200 Subject: [PATCH] fix: add microdnf/dnf support and skip downloading if on PATH --- action.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 3f443bc..2fb4caa 100644 --- a/action.yml +++ b/action.yml @@ -49,11 +49,17 @@ runs: command -v bzip2 >/dev/null 2>&1 || MISSING="$MISSING bzip2" command -v zstd >/dev/null 2>&1 || MISSING="$MISSING zstd" if [ -n "$MISSING" ]; then + SUDO="" + command -v sudo >/dev/null 2>&1 && SUDO="sudo" if command -v apt-get >/dev/null 2>&1; then export DEBIAN_FRONTEND=noninteractive - sudo apt-get update && sudo apt-get install -y $MISSING + $SUDO apt-get update && $SUDO apt-get install -y $MISSING + elif command -v microdnf >/dev/null 2>&1; then + $SUDO microdnf install -y --setopt=install_weak_deps=0 --nodocs $MISSING + elif command -v dnf >/dev/null 2>&1; then + $SUDO dnf install -y --setopt=install_weak_deps=0 --nodocs $MISSING else - echo "::warning::Missing dependencies ($MISSING) could not be installed because 'apt-get' is not available. Please install them manually." + echo "::warning::Missing dependencies ($MISSING) could not be installed because a supported package manager (apt-get, microdnf, dnf) is not available. Please install them manually." fi fi @@ -65,6 +71,14 @@ runs: run: | set -euo pipefail + # Skip downloading if aetherpak is already available on PATH + if command -v aetherpak >/dev/null 2>&1; then + echo "aetherpak is already installed on PATH. Skipping download." + echo "version=existing" >> "$GITHUB_OUTPUT" + echo "path=$(dirname "$(command -v aetherpak)")" >> "$GITHUB_OUTPUT" + exit 0 + fi + # 1. Map Arch case "$(echo "$RUNNER_ARCH" | tr '[:upper:]' '[:lower:]')" in x64|amd64) ARCH="amd64" ;;