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 | |
HOOK_URL=<SLACK_HOOK_URL> | |
CHANNEL=<TARGET_CHANNEL> | |
REPO_NAME=`git config --get remote.origin.url | awk 'match($0,/\/([a-zA-Z1-9-]*)/) {print substr($0,RSTART+1,RLENGTH-1)}'` | |
REPO_URL=`git config remote.origin.url | sed 's/.*@\(.*\)\.git/\1/g' | sed 's/:/\//'`/pull | |
ESCAPED_REPO_URL=`echo $REPO_URL | sed 's/\//\\\\\//g'` #so many slashes! | |
read a b <<< $(git tag -l --sort=version:refname "v*" | tail -2) | |
read PULL_REQUESTS <<< $(git log --oneline $a...$b | grep "pull request" | awk 'match($0,/#[0-9]*/) {print substr($0,RSTART,RLENGTH)}') | |
PRS_WITH_LINKS=`echo $PULL_REQUESTS | sed -E "s/#([0-9]*)([ ]|$)/<https:\/\/$ESCAPED_REPO_URL\/\1|&> /g"` |
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
https://giphy.com/gifs/rainbow-timelapse-fUDsTIDbCn2Vy |