From 0ef6afefecd4e1424866f0aab2b1c3a01e045cbc Mon Sep 17 00:00:00 2001 From: Nuno Pires Date: Tue, 2 Dec 2025 22:09:36 +0100 Subject: [PATCH 1/4] fix: silence tar extraction --- setup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.sh b/setup.sh index 426c085..9694e6e 100755 --- a/setup.sh +++ b/setup.sh @@ -124,7 +124,6 @@ else unzip -q "${ASSET_NAME}" elif [[ "${ASSET_NAME}" == *.tar.gz ]]; then info "Extracting ${ASSET_NAME}" - tar tzf "${ASSET_NAME}" tar xzf "${ASSET_NAME}" fi From 9c01a36d426d341480270da8648daee21ce96e7c Mon Sep 17 00:00:00 2001 From: Nuno Pires Date: Wed, 3 Dec 2025 09:51:51 +0100 Subject: [PATCH 2/4] fix: log if debug is enabled Signed-off-by: Nuno Pires --- setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 9694e6e..218423b 100755 --- a/setup.sh +++ b/setup.sh @@ -121,9 +121,10 @@ else if [[ "${ASSET_NAME}" == *.zip ]]; then info "Extracting ${ASSET_NAME}" - unzip -q "${ASSET_NAME}" + [[ "${RUNNER_DEBUG:-0}" == "1" ]] && unzip "${ASSET_NAME}" || unzip -q "${ASSET_NAME}" elif [[ "${ASSET_NAME}" == *.tar.gz ]]; then info "Extracting ${ASSET_NAME}" + [[ "${RUNNER_DEBUG:-0}" == "1" ]] && tar tzf "${ASSET_NAME}" tar xzf "${ASSET_NAME}" fi From cfade694ed7fb833bf6b73b4280249c9b54f7f41 Mon Sep 17 00:00:00 2001 From: Nuno Pires Date: Wed, 3 Dec 2025 09:56:53 +0100 Subject: [PATCH 3/4] fix: abstract Signed-off-by: Nuno Pires --- setup.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 218423b..22a8556 100755 --- a/setup.sh +++ b/setup.sh @@ -2,8 +2,13 @@ set -euo pipefail +# Function to run commands only in debug mode +debug() { + [[ "${RUNNER_DEBUG:-0}" == "1" ]] && "$@" +} + # Enable debug mode if RUNNER_DEBUG is 1 -[[ "${RUNNER_DEBUG:-0}" == "1" ]] && set -x +debug set -x # Function to print error and exit error() { @@ -121,10 +126,11 @@ else if [[ "${ASSET_NAME}" == *.zip ]]; then info "Extracting ${ASSET_NAME}" - [[ "${RUNNER_DEBUG:-0}" == "1" ]] && unzip "${ASSET_NAME}" || unzip -q "${ASSET_NAME}" + debug unzip -l "${ASSET_NAME}" + unzip -q "${ASSET_NAME}" elif [[ "${ASSET_NAME}" == *.tar.gz ]]; then info "Extracting ${ASSET_NAME}" - [[ "${RUNNER_DEBUG:-0}" == "1" ]] && tar tzf "${ASSET_NAME}" + debug tar tzf "${ASSET_NAME}" tar xzf "${ASSET_NAME}" fi From 17161fb788b53f68aa37e6b8e5a13800ae743bfa Mon Sep 17 00:00:00 2001 From: Nuno Pires Date: Wed, 3 Dec 2025 10:03:34 +0100 Subject: [PATCH 4/4] fix: debug func Signed-off-by: Nuno Pires --- setup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 22a8556..54402e5 100755 --- a/setup.sh +++ b/setup.sh @@ -4,7 +4,9 @@ set -euo pipefail # Function to run commands only in debug mode debug() { - [[ "${RUNNER_DEBUG:-0}" == "1" ]] && "$@" + if [[ "${RUNNER_DEBUG:-0}" == "1" ]]; then + "$@" | sed 's/^/DEBUG: /g' + fi } # Enable debug mode if RUNNER_DEBUG is 1