From c1896220a3e67265394de12c6cbe1088f132f525 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 13 Jun 2026 23:49:32 +0000 Subject: [PATCH] Support legacy argument order for package parsing scripts --- post_cache_action.sh | 12 ++++++++---- pre_cache_action.sh | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) 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..."