From 0c6515e018198cef77a9654d18d6399008f7bc74 Mon Sep 17 00:00:00 2001 From: Gautam Botrel Date: Fri, 13 Sep 2024 20:08:51 -0500 Subject: [PATCH] build: test ci --- .github/workflows/slack-notifications.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/slack-notifications.yml b/.github/workflows/slack-notifications.yml index 41d0fc849..0e5ac3202 100644 --- a/.github/workflows/slack-notifications.yml +++ b/.github/workflows/slack-notifications.yml @@ -63,7 +63,9 @@ jobs: ] }') else - payload=$(jq -n --arg repository "${{ inputs.repository }}" --arg branch "${{ inputs.branch }}" --arg actor "${{ inputs.actor }}" --arg run_id "${{ inputs.run_id }}" --arg failures "${{ inputs.failures }}" '{ + # Escape the failures input for JSON and Slack + escaped_failures=$(echo "${{ inputs.failures }}" | jq -sRr @json | sed 's/\\n/\\n/g') + payload=$(jq -n --arg repository "${{ inputs.repository }}" --arg branch "${{ inputs.branch }}" --arg actor "${{ inputs.actor }}" --arg run_id "${{ inputs.run_id }}" --arg failures "$escaped_failures" '{ "channel": "team-gnark-build", "text": "GitHub Action build result: failure", "blocks": [ @@ -78,14 +80,14 @@ jobs: "type": "section", "text": { "type": "mrkdwn", - "text": "*Failed Step:* " + "text": "" } }, { "type": "section", "text": { "type": "mrkdwn", - "text": "*Test Failure Details:* \($failures)" + "text": "*Failed tests:*\n\n\($failures)" } }, {