Skip to content

Instantly share code, notes, and snippets.

@lktslionel
Last active December 15, 2022 16:00
Show Gist options
  • Save lktslionel/188c1a1410d149a0090b5293e0381c77 to your computer and use it in GitHub Desktop.
Save lktslionel/188c1a1410d149a0090b5293e0381c77 to your computer and use it in GitHub Desktop.
GitHub Actions Tips & Tricks

GitHub Actions Tips & Tricks.md

  1. Github ternary operator: Set a value if not defined
${{ x && <yes> || <false> }}
  1. Read data from a computed json
run: |
  echo 'DATA=$(echo '["a", "b", "c"]' | jq -r '@json'' >> $GITHUB_OUTPUT 

# workflow file
data: "${{ fromJSON(steps.<id>.outputs.DATA) }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment