We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40fb7f5 commit 964b515Copy full SHA for 964b515
.woodpecker/buildSlackNotify.sh
@@ -1,6 +1,5 @@
1
#!/bin/sh
2
3
-set -x
4
5
COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c1-8)
6
@@ -23,6 +22,8 @@ if [ "$CI_STEP_STATUS" = "success" ]; then
23
22
fi
24
export BUILD_LOG=$(cat ./build.log)
25
+## escape double quotes in the build log
26
+BUILD_LOG=$(echo $BUILD_LOG | sed 's/"/\\"/g')
27
28
MESSAGE="Broke \`$CI_REPO_NAME/$CI_COMMIT_BRANCH\` with commit _${CI_COMMIT_MESSAGE}_ (<$CI_COMMIT_URL|$COMMIT_SHORT_SHA>)"
29
CODE_BLOCK="\`\`\`$BUILD_LOG\n\`\`\`"
@@ -40,4 +41,4 @@ curl -sS -X POST -H "Content-Type: application/json" -d '{
40
41
"pretext": "'"$MESSAGE"'"
42
}
43
]
-}' "$DEVELOPERS_SLACK_WEBHOOK"
44
+}' "$DEVELOPERS_SLACK_WEBHOOK" 2>&1
0 commit comments