Skip to content

Instantly share code, notes, and snippets.

@bradyclifford
Created March 15, 2022 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradyclifford/78247cff84341ba1ca27a1a15d477be7 to your computer and use it in GitHub Desktop.
Save bradyclifford/78247cff84341ba1ca27a1a15d477be7 to your computer and use it in GitHub Desktop.
JQ Scripts
#!/bin/sh
JSON=$(<test.json)
for encodedPair in $(echo "${JSON}" | jq -r 'to_entries[] | @base64'); do
__jq() {
echo "${encodedPair}" | base64 --decode | jq -r ${1}
}
key=$(__jq '.key')
value=$(__jq '.value')
echo "::set-output name=${key}::${value}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment