File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed
Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change 4444 required : false
4545
4646jobs :
47- docker-push :
48- name : ${{ matrix.role }} images
47+ # matrix_builder generates a matrix that includes the roles selected in the input
48+ matrix_builder :
4949 runs-on : ubuntu-latest
50-
51- # setup jobs for each role
52- strategy :
53- fail-fast : false
54- matrix :
55- role : ${{ steps.set-matrix.outputs.roles }}
56-
50+ outputs :
51+ matrix : ${{ steps.generate.outputs.matrix }}
5752 steps :
58- # select the roles to add to the matrix based on the input selections
59- - id : set-matrix
53+ - id : generate
6054 run : |
6155 roles=()
6256 if [[ "${{ inputs.build_access }}" = "true" ]]; then
7872 roles+=( "observer" )
7973 fi
8074 rolesJSON=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${X[@]}")
81- echo "roles=${rolesJSON}" >> $GITHUB_OUTPUT
75+ echo "matrix={\"roles\":$(echo $rolesJSON)}" >> $GITHUB_OUTPUT
76+ docker-push :
77+ name : ${{ matrix.role }} images
78+ runs-on : ubuntu-latest
79+ needs : matrix_builder
80+
81+ # setup jobs for each role
82+ strategy :
83+ fail-fast : false
84+ matrix : ${{ fromJson(needs.matrix_builder.outputs.matrix) }}
85+
86+ steps :
8287 - name : Setup Go
8388 uses : actions/setup-go@v2
8489 with :
You can’t perform that action at this time.
0 commit comments