diff --git a/.github/actions/send-teams-notification/action.yml b/.github/actions/send-teams-notification/action.yml index 9b661779b..12530cf79 100644 --- a/.github/actions/send-teams-notification/action.yml +++ b/.github/actions/send-teams-notification/action.yml @@ -58,6 +58,15 @@ runs: SMALL_SHA=${GITHUB_LONG_SHA:0:6} echo "result=$SMALL_SHA" >> $GITHUB_OUTPUT + - name: Compute needs + id: compute-needs + shell: bash + env: + NEEDS: ${{ inputs.needs }} + run: | + NEEDS_OUTPUT=$(echo $NEEDS | jq -r 'to_entries[] | "\(.key): \(.value.result)"') + echo "result=$NEEDS_OUTPUT" >> $GITHUB_OUTPUT + - name: Compute message id: compute-message shell: bash @@ -68,6 +77,7 @@ runs: PR_TITLE: ${{ github.event.pull_request.title }} ISSUE_BODY: ${{ github.event.issue.body }} COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + NEEDS: ${{ steps.compute-needs.outputs.result }} run: | ${{ github.action_path }}/compute-message.sh >> $GITHUB_OUTPUT diff --git a/.github/actions/send-teams-notification/compute-message.sh b/.github/actions/send-teams-notification/compute-message.sh index dc6ef3b7b..4c573cc4b 100755 --- a/.github/actions/send-teams-notification/compute-message.sh +++ b/.github/actions/send-teams-notification/compute-message.sh @@ -23,6 +23,10 @@ if [ -n "$BLOCK_MESSAGE" ]; then COMPUTED_MESSAGE="${COMPUTED_MESSAGE}$BLOCK_MESSAGE" fi +if [ -n "$NEEDS" ]; then + COMPUTED_MESSAGE="${COMPUTED_MESSAGE}\n\n$NEEDS" +fi + if [ -n "$COMPUTED_MESSAGE" ]; then COMPUTED_MESSAGE="${COMPUTED_MESSAGE}" COMPUTED_MESSAGE=$(printf "${COMPUTED_MESSAGE}" | sed -z 's/\n/\\n/g' | sed -r 's/"/\\\"/g' | sed -e 's/\r//g')