Skip to content

Commit

Permalink
fix https://www.shellcheck.net/wiki/SC3011 and new test scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmaida committed Apr 12, 2024
1 parent 6cad5b6 commit e59682f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion task/jq/0.1/jq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion task/jq/0.1/test/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e59682f

Please sign in to comment.