Created
May 23, 2021 08:40
-
-
Save shimesaba-type0/45994d0e49aef1b959ead3a1eb6eb2a0 to your computer and use it in GitHub Desktop.
memo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
cd $(dirname $0) | |
# slack webhook url | |
URL="https://hooks.slack.com/services/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" | |
# CURL="/usr/bin/curl" | |
# method -X | |
METHOD="POST" | |
# header -H | |
HEADER="'Content-type: application/json'" | |
TYPE="application/json" | |
# payload | |
# PAYLOAD="{\"text\":\"hello, world\"}" | |
PAYLOAD=$(cat << EOS | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "This is a mrkdwn section block :ghost: ${METHOD} " | |
} | |
} | |
EOS | |
) | |
echo \"$PAYLOAD\" | |
exit | |
# exit | |
/usr/bin/curl -sSv \ | |
-X ${METHOD} \ | |
-H "'Content-type: "${TYPE}"'" \ | |
--data \"${PAYLOAD}\" \ | |
${URL} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment