File tree Expand file tree Collapse file tree 2 files changed +33
-13
lines changed Expand file tree Collapse file tree 2 files changed +33
-13
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,18 @@ jobs:
27
27
matrix-key : ${{ matrix.target }}
28
28
outputs : |-
29
29
result: ${{ matrix.target }}
30
+ test: existing_value
30
31
31
32
- uses : nick-fields/assert-action@v1
32
33
with :
33
34
expected : ${{ matrix.target }}
34
35
actual : ${{ fromJson(steps.writer.outputs.result).result }}
35
36
37
+ - uses : nick-fields/assert-action@v1
38
+ with :
39
+ expected : existing_value
40
+ actual : ${{ fromJson(steps.writer.outputs.result).test }}
41
+
36
42
test :
37
43
runs-on : ubuntu-latest
38
44
continue-on-error : true
Original file line number Diff line number Diff line change @@ -35,26 +35,40 @@ runs:
35
35
actual : " ${{ inputs.matrix-key }}"
36
36
comparison : notEqual
37
37
38
- -
uses : cloudposse/[email protected]
39
- id : proxy
38
+ - name : ' Install jq 1.6 '
39
+
40
40
with :
41
- query : .
42
- config : |-
43
- result:
44
- ${{ inputs.outputs }}
41
+ version : 1.6
42
+ force : ' true'
45
43
46
- -
uses :
cloudposse/[email protected]
47
- id : write
44
+ - name : ' Setup yq'
45
+
46
+ with :
47
+ version : v4.28.1
48
+ download-compressed : true
49
+ force : true
50
+
51
+ - shell : bash
52
+ id : proxy
53
+ run : |-
54
+ JSON=$(echo "${{ inputs.outputs }}" | yq '. + {}' -o json | jq . -c -M -e)
55
+ echo "result=${JSON}" >> $GITHUB_OUTPUT
56
+
57
+ -
uses :
cloudposse/[email protected]
58
+ id : mask
48
59
with :
49
60
query : .${{ inputs.matrix-key == '' }}
50
61
config : |-
51
62
true:
52
- result:
53
- ${{ inputs.outputs }}
63
+ mask: ". + {}"
54
64
false:
55
- result:
56
- ${{ inputs.matrix-key || 'null' }}:
57
- ${{ inputs.outputs }}
65
+ mask: "{\"${{ inputs.matrix-key}}\": . + {}}"
66
+
67
+ - shell : bash
68
+ id : write
69
+ run : |-
70
+ JSON=$(echo "${{ inputs.outputs }}" | yq '${{ steps.mask.outputs.mask }}' -o json | jq . -c -M -e)
71
+ echo "result=${JSON}" >> $GITHUB_OUTPUT
58
72
59
73
- shell : bash
60
74
if : ${{ inputs.outputs != '' && inputs.matrix-step-name != '' }}
You can’t perform that action at this time.
0 commit comments