From c1a50bb848885eee530facbb7c025761ca2f68ef Mon Sep 17 00:00:00 2001 From: Brian Shore Date: Mon, 9 Sep 2024 10:12:47 -0700 Subject: [PATCH] Use named parameters in bash function --- action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index dc49eba..9c0836f 100644 --- a/action.yml +++ b/action.yml @@ -234,15 +234,15 @@ runs: mkdir -p ./out - package() { + package() { local pkg_type="$1" deps="${2:-}" local config_file - config_file="nfpm_${1}_config.yml" - if ! INPUT_DEPENDS="$2" nfpm_template > "$config_file"; then - printf "failed to executing nfpm_template for $1" + config_file="nfpm_${pkg_type}_config.yml" + if ! INPUT_DEPENDS="$deps" nfpm_template > "$config_file"; then + printf "failed to executing nfpm_template for $pkg_type" exit 1 fi cat "$config_file" - nfpm package -f "$config_file" -p ${1} -t ./out/ + nfpm package -f "$config_file" -p "$pkg_type" -t ./out/ } package rpm "$INPUT_RPM_DEPENDS"