Array output to matrix input


I have a workflow that is as follows:

creates an output1 that is an array of strings

services: [ ${{needs.job1.outputs.output1}} ]

Github actions interprets the output1 (which is an array) to be 1 item in of itself. So if my ouptut1 is [text1, text2] then it will make a matrix with 1 item of [text1, text2] What I want is the output from job1 to become the array that is set in the matrix, so that it runs an action for text1 and text2. How would I do this?

Thank you in advance!

If output1 is an array, then you shouldn’t wrap it again in square brackets:

services: ${{needs.job1.outputs.output1}}

If it’s not actually an array to the workflow for whatever reason (are outputs always strings perhaps?), then you could try toJSON() and fromJSON() to serialize it as string and parse it back into an array.