Skip to content

Commit b4c1308

Browse files
authored
Merge pull request #190 from gsteel/multiline-output-fix
Prevent multiline matrix payload from causing issues in GitHub workflow output
2 parents ca11cee + 5d487a4 commit b4c1308

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ jobs:
2525
# This provides a dedicated "check" to asynchronously test all integration tests within the tests/ directory
2626
# The project name from the tests/ directory is then re-used within the "qa" job to run the generated "container"
2727
# within that directory.
28-
run: cd tests; echo "matrix=[\"$(ls -d * | tr '\n' ' ' | sed 's/ $//' | sed 's/ /\",\"/g')\"]" >> $GITHUB_OUTPUT
28+
run: |
29+
cd tests;
30+
echo 'matrix<<EOF' >> $GITHUB_OUTPUT
31+
echo "[\"$(ls -d * | tr '\n' ' ' | sed 's/ $//' | sed 's/ /\",\"/g')\"]" >> $GITHUB_OUTPUT
32+
echo 'EOF' >> $GITHUB_OUTPUT
2933
3034
container:
3135
name: Prepare docker container
@@ -89,14 +93,16 @@ jobs:
8993
- name: "Output generated matrix"
9094
uses: sergeysova/jq-action@v2
9195
with:
92-
cmd: "jq . < <(echo '${{ steps.matrix_generation.outputs.matrix }}')"
96+
multiline: true
97+
cmd: "jq . < <(echo '${{ steps.matrix_generation.outputs.matrix }}')"
9398

9499
- name: Minify matrix from test directory
95100
uses: sergeysova/jq-action@v2
96101
id: expected_matrix
97102
env:
98103
PROJECT_NAME_TO_TEST: ${{ matrix.projectName }}
99104
with:
105+
multiline: true
100106
cmd: 'jq -c . < tests/${PROJECT_NAME_TO_TEST}/matrix.json'
101107

102108
- name: "verify output of generated matrix for project: ${{ matrix.projectName }}"

0 commit comments

Comments
 (0)