From e59682fd7225fcafb77dc137e920add29b209e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Maida?= Date: Fri, 12 Apr 2024 16:18:12 -0300 Subject: [PATCH] fix https://www.shellcheck.net/wiki/SC3011 and new test scenario --- task/jq/0.1/jq.yaml | 3 ++- task/jq/0.1/test/pipeline.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/task/jq/0.1/jq.yaml b/task/jq/0.1/jq.yaml index 96e450ec5c..2f2a590aad 100644 --- a/task/jq/0.1/jq.yaml +++ b/task/jq/0.1/jq.yaml @@ -58,7 +58,8 @@ spec: echo "JQ script result:" if [ "string" = "$(params.stringOrFile)" ]; then - jq "$(params.options)" '$(params.filter)' <<< "$(params.input)" | tee "$(results.jq-script-outcome.path)" + echo "$(params.input)" > tmp.json + jq "$(params.options)" '$(params.filter)' tmp.json | tee "$(results.jq-script-outcome.path)" else jq "$(params.options)" '$(params.filter)' "$(params.input)" | tee "$(results.jq-script-outcome.path)" fi \ No newline at end of file diff --git a/task/jq/0.1/test/pipeline.yaml b/task/jq/0.1/test/pipeline.yaml index a7abc347a7..9ae987948e 100644 --- a/task/jq/0.1/test/pipeline.yaml +++ b/task/jq/0.1/test/pipeline.yaml @@ -32,7 +32,8 @@ spec: - name: jq-using-string-as-input-with-wild-filter params: - name: filter - value: "map(length) | max_by(.) as $max_length | .[] | select(length == $max_length)" + # value: "map(length) | max_by(.) as $max_length | .[] | select(length == $max_length)" + value: map_values(if type == "string" then . | split("") | reverse | join("") | ascii_upcase else . end) - name: input value: '[\"apple\", \"banana\", \"orange\", \"grape\", \"kiwi\", \"siriguela\"]' - name: stringOrFile