Skip to content

json + matrix + output + jq + toJSON #2199

Answered by bukowa
bukowa asked this question in Q&A
Discussion options

You must be logged in to vote

Works for me:

# i used this  to set output
run: |
  set -eux
  DATA=$(echo ${{ steps.changed-files-specific.outputs.all_changed_files }} | jq -c '. | map(split("/")[0]) | unique')
  echo "matrix=$DATA" >> "$GITHUB_OUTPUT"

# and this to load
strategy:
  matrix:
    charts: ${{ fromJSON(needs.changed-files.outputs.matrix) }}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by bukowa
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants