This file contains 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/sh | |
# Posts a message to slack with the change history since the last release. | |
# Assumes you are tagging changes on production deploys with a handy prefix like: | |
# git tag release-`date \"+%Y%m%d_%H%M%S\"` && git push origin --tags | |
# Also you must have configured a slack https://api.slack.com/incoming-webhooks for your team. | |
RELEASE_TAG_PREFIX=release | |
LAST_CHANGE=$(git rev-list --tags="$RELEASE_TAG_PREFIX*" --no-walk --max-count=1 --abbrev-commit) | |
CHANGELOG=$(git log ${LAST_CHANGE}..HEAD --pretty="format:%<(10)%h %an: %s" -- .) | |
CHANGELOG=${CHANGELOG//\\/\\\\} # replace \ with \\ |