From fe9dee4cf05fe9872de7c112f7603d8690389b6c Mon Sep 17 00:00:00 2001 From: Anahide Tchertchian <608958+atchertchian@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:09:58 +0100 Subject: [PATCH] AAE-28530 Fix teams notif management of multiple "needs" info (#827) --- .github/actions/send-teams-notification/action.yml | 5 +++-- .../tests/send-teams-notification.bats | 7 ++----- version.txt | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/actions/send-teams-notification/action.yml b/.github/actions/send-teams-notification/action.yml index ff6a367ca..b173bfce1 100644 --- a/.github/actions/send-teams-notification/action.yml +++ b/.github/actions/send-teams-notification/action.yml @@ -64,8 +64,9 @@ runs: env: NEEDS: ${{ inputs.needs }} run: | - NEEDS_OUTPUT=$(echo $NEEDS | jq -r 'to_entries[] | "\(.key): \(.value.result)"') - echo "result=$NEEDS_OUTPUT" >> $GITHUB_OUTPUT + echo "result<> $GITHUB_OUTPUT + echo $NEEDS | jq -r 'to_entries | map([.key, .value.result]|join(": ")) | join("\n\n")' >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - name: Compute message id: compute-message diff --git a/.github/actions/send-teams-notification/tests/send-teams-notification.bats b/.github/actions/send-teams-notification/tests/send-teams-notification.bats index a290300ac..001d8772e 100644 --- a/.github/actions/send-teams-notification/tests/send-teams-notification.bats +++ b/.github/actions/send-teams-notification/tests/send-teams-notification.bats @@ -257,7 +257,7 @@ BATS @test "needs" { export NEEDS_JSON=$(<$BATS_TEST_DIRNAME/sample-needs.json) - export NEEDS=$(echo $NEEDS_JSON | jq -r 'to_entries[] | "\(.key): \(.value.result)"') + export NEEDS=$(echo $NEEDS_JSON | jq -r 'to_entries | map([.key, .value.result]|join(": ")) | join("\n\n")') run compute-message.sh @@ -265,14 +265,11 @@ BATS expected_output=$(cat << 'BATS' result<