Skip to content

Commit

Permalink
stringify output
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Nov 20, 2024
1 parent e2efc45 commit 63b4d0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion actions/get-resource/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ runs:
run: |
RESOURCE=$(ctrlc api get resource --id ${{ inputs.resource_id }})
echo "resource=$RESOURCE" >> "$GITHUB_OUTPUT"
# JSON stringify the resource
RESOURCE_STRING=$(echo "$RESOURCE" | jq -c '.')
echo "resource=$RESOURCE_STRING" >> "$GITHUB_OUTPUT"
# Extract flattened key-value pairs and write to output
echo "$RESOURCE" | jq -r 'paths(scalars) as $p | [ ( [ $p[] | tostring ] | join("_") | gsub("/"; "_") ), ( getpath($p) | tostring ) ] | join("=")' | while read -r line; do
Expand Down

0 comments on commit 63b4d0b

Please sign in to comment.