Created
November 9, 2017 02:16
-
-
Save mikeabreu/2545883919fa97833485182fc541b88a to your computer and use it in GitHub Desktop.
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 | |
# SLACK_WEBHOOK=$(printenv YOUR_SLACK_WEBHOOK) | |
SLACK_WEBHOOK="<INSERT_YOUR_SLACK_WEBHOOK>" | |
f_send_slack() { | |
SLACK_TEXT="$@" | |
SLACK_JSON="""payload={ | |
\"channel\": \"#general\", | |
\"username\": \"your-slack-bot\", | |
\"icon_emoji\": \":monkey_face:\", | |
\"text\": \"${SLACK_TEXT}\" | |
}""" | |
curl -s -X POST \ | |
--data-urlencode "${SLACK_JSON}" \ | |
$SLACK_WEBHOOK > /dev/null | |
} | |
# f_send_slack "Your messages" | |
f_send_slack "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment