Last active
September 8, 2015 09:52
-
-
Save AshCoolman/bef2781f73521dddf593 to your computer and use it in GitHub Desktop.
Tell (Slack) webhook your last X commits
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
# Usage: | |
# | |
# ``` | |
# $sh tell-slack-git-log.sh 2 | |
# ``` | |
# | |
# Creates slack message: | |
# ``` | |
# Changes: | |
# | |
# 8d4b18d update (blah): Added thing | |
# b4e5753 update (blee): Added another | |
# ``` | |
icon="mega" | |
channel="@coolman" | |
username="bot" | |
slackhook="https://hooks.slack.com/services/<ENTER_YOUR/SLACK_WEBHOOK_HERE>" | |
changes=$(git log --pretty=oneline --abbrev-commit -$1) | |
curl -X POST --data-urlencode "payload={\"channel\": \"$channel\", \"username\": \"$username\", \"text\": \"Changes:\n\n$changes\", \"icon_emoji\": \":$icon:\"}" $slackhook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment