Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 964b515

Browse filesBrowse files
committed
(autorelease) fix: escape double quotes in payload
1 parent 40fb7f5 commit 964b515
Copy full SHA for 964b515

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed

‎.woodpecker/buildSlackNotify.sh

Copy file name to clipboardExpand all lines: .woodpecker/buildSlackNotify.sh
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/sh
22

3-
set -x
43

54
COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | cut -c1-8)
65

@@ -23,6 +22,8 @@ if [ "$CI_STEP_STATUS" = "success" ]; then
2322
fi
2423
export BUILD_LOG=$(cat ./build.log)
2524

25+
## escape double quotes in the build log
26+
BUILD_LOG=$(echo $BUILD_LOG | sed 's/"/\\"/g')
2627

2728
MESSAGE="Broke \`$CI_REPO_NAME/$CI_COMMIT_BRANCH\` with commit _${CI_COMMIT_MESSAGE}_ (<$CI_COMMIT_URL|$COMMIT_SHORT_SHA>)"
2829
CODE_BLOCK="\`\`\`$BUILD_LOG\n\`\`\`"
@@ -40,4 +41,4 @@ curl -sS -X POST -H "Content-Type: application/json" -d '{
4041
"pretext": "'"$MESSAGE"'"
4142
}
4243
]
43-
}' "$DEVELOPERS_SLACK_WEBHOOK"
44+
}' "$DEVELOPERS_SLACK_WEBHOOK" 2>&1

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.