diff --git a/post_cache_action.sh b/post_cache_action.sh index a6a5689..e057f72 100755 --- a/post_cache_action.sh +++ b/post_cache_action.sh @@ -26,10 +26,14 @@ debug="${5}" test "${debug}" = "true" && set -x # Repositories to add before installing packages. -add_repository="${6}" - -# List of the packages to use. -packages="${@:7}" +# Keep compatibility with older action versions that only passed 6 args. +if [ "$#" -ge 7 ]; then + add_repository="${6}" + packages="${@:7}" +else + add_repository="" + packages="${@:6}" +fi if test "${cache_hit}" = "true"; then ${script_dir}/restore_pkgs.sh "${cache_dir}" "${cache_restore_root}" "${execute_install_scripts}" "${debug}" diff --git a/pre_cache_action.sh b/pre_cache_action.sh index 5cb64cb..902a4b7 100755 --- a/pre_cache_action.sh +++ b/pre_cache_action.sh @@ -25,10 +25,14 @@ execute_install_scripts="${3}" debug="${4}" # Repositories to add before installing packages. -add_repository="${5}" - -# List of the packages to use. -input_packages="${@:6}" +# Keep compatibility with older action versions that only passed 5 args. +if [ "$#" -ge 6 ]; then + add_repository="${5}" + input_packages="${@:6}" +else + add_repository="" + input_packages="${@:5}" +fi # Trim commas, excess spaces, and sort. log "Normalizing package list..."