generated from cloudposse-github-actions/composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
action.yml
30 lines (28 loc) · 880 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: 'Matrix outputs - read'
description: 'Read outputs for matrix'
author: [email protected]
branding:
icon: 'chevrons-down'
color: 'white'
inputs:
matrix-step-name:
required: true
description: "Matrix step name"
outputs:
result:
description: "Outputs result"
value: "${{ steps.context.outputs.result }}"
runs:
using: "composite"
steps:
- name: 'Setup jq'
uses: dcarbone/[email protected]
with:
version: 1.6
force: 'true'
- uses: actions/download-artifact@v4
- id: context
shell: bash
run: |
result="$(find . -name ${{ inputs.matrix-step-name }} -maxdepth 2 -exec cat {} \; | jq -c --slurp 'map(to_entries | map(.key as $matrix_key | .value | map_values({($matrix_key): .}))) | flatten | reduce .[] as $item ({}; . * $item)' )"
echo "result=${result}" >> $GITHUB_OUTPUT