From f33559582dbb44ea7e969dbe0b938574f8d2f3dd Mon Sep 17 00:00:00 2001 From: Nick Novitski Date: Thu, 19 Oct 2023 10:13:44 -0700 Subject: [PATCH] fix: Pass arguments The INPUTS_* environment variables are not present in composite actions. A flag interface seems more intuitive for local testing too. --- action.yml | 2 +- nix-develop-gha.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 28c4d58..3bbf3b0 100644 --- a/action.yml +++ b/action.yml @@ -8,4 +8,4 @@ runs: using: "composite" steps: - shell: bash - run: ${{ github.action_path }}/nix-develop-gha.sh + run: ${{ github.action_path }}/nix-develop-gha.sh ${{ inputs.arguments }} diff --git a/nix-develop-gha.sh b/nix-develop-gha.sh index 79ffa1e..7f8e6cb 100755 --- a/nix-develop-gha.sh +++ b/nix-develop-gha.sh @@ -2,8 +2,8 @@ set -euo pipefail -# Read the arguments input into an array, so it can be added to a command line. -IFS=" " read -r -a arguments <<<"${INPUT_ARGUMENTS:-}" +# Read the arguments into an array, so they can be added correctly as flags +IFS=" " read -r -a arguments <<<"${@:-}" with_nix_develop() { nix develop --ignore-environment "${arguments[@]}" --command "$@"