From 8edd02fb8b2a88a230cd154a1da5f09017c78888 Mon Sep 17 00:00:00 2001 From: Red Mushie Date: Sat, 30 Sep 2023 13:08:57 +0200 Subject: [PATCH] ci: Have jq output in compact mode --- .github/workflows/targets.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/targets.yml b/.github/workflows/targets.yml index a4bfb5db..e5125a5c 100644 --- a/.github/workflows/targets.yml +++ b/.github/workflows/targets.yml @@ -36,6 +36,7 @@ jobs: # # jq: # "--raw-input --slurp" Takes the previous output, + # -c Output in compact mode (no newlines or unnecessary spaces), # split("\n") Splits it by line, turning it into an array, # [ .[] | select(length > 0) ] Filters out empty lines (there is an empty trailing line usually), # { board: ... } Wraps the whole thing into a JSON object with only a "board" key @@ -48,4 +49,4 @@ jobs: - name: Extract targets id: targets run: | - echo "matrix=$(sed -n "s/^\[env:\(.*\)]$/\1/p" platformio.ini | jq --raw-input --slurp '{ board: split("\n") | [ .[] | select(length > 0) ] }')" >> $GITHUB_OUTPUT + echo "matrix=$(sed -n "s/^\[env:\(.*\)]$/\1/p" platformio.ini | jq --raw-input --slurp -c '{ board: split("\n") | [ .[] | select(length > 0) ] }')" >> $GITHUB_OUTPUT