Skip to content

Commit 786e510

Browse files
also escape "
1 parent 3d8ba2e commit 786e510

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/e2e-test.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ jobs:
4545
mvn $MVN_ARGS "-Daicore.landscape=${{ matrix.environment }}" | tee mvn_output.log # tee writes to both the console and a file
4646
4747
awk '/Results:/, /----/' mvn_output.log > test_error.log || true # true ensures the step doesn't fail if no match is found.
48-
ERROR_MSG=$(cat test_error.log | tail +4 | head -n -4 | sed ':a;N;$!ba;s/\n/\\n/g') # Slack formatting
48+
ERROR_MSG=$(cat test_error.log | tail +4 | head -n -4 | awk '{gsub(/"/, "\\\""); printf "%s\\n", $0}') # Slack formatting
49+
echo "error_message=$ERROR_MSG"
4950
echo "error_message=$ERROR_MSG" >> $GITHUB_OUTPUT
5051
5152
if grep -q "BUILD FAILURE" mvn_output.log; then
@@ -89,7 +90,9 @@ jobs:
8990
webhook: ${{ secrets.SLACK_WEBHOOK }}
9091
webhook-type: incoming-webhook
9192
payload: |
92-
{
93-
"text": "⚠️ End-to-end tests failed! 😬 Please inspect & fix by clicking <https://github.com/SAP/ai-sdk-java/actions/runs/${{ github.run_id }}|here>\n\n*Test Errors:*\n${{ steps.run_tests.outputs.error_message }}"
94-
}
95-
93+
text: "⚠️ End-to-end tests failed! 😬 Please inspect & fix by clicking <https://github.com/SAP/ai-sdk-java/actions/runs/${{ github.run_id }}|here>",
94+
blocks:
95+
- type: "section"
96+
text:
97+
type: "plain_text"
98+
text: "${{ steps.run_tests.outputs.error_message }}"

0 commit comments

Comments
 (0)