Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/bin/bash -ex
curl -X POST --data-urlencode "payload={\"channel\": \"$1\", \"attachments\": [{\"title\":\"Merged branches report:\", \"text\":\"$2\",\"mrkdwn_in\":[\"text\"]}], \"icon_emoji\":\":shipit:\"}"
cd $REPO
git fetch -a --prune
declare -a textArray
git branch -r --merged origin/master | \
awk '{branch=substr($1,8); if(branch!="HEAD" && branch!="master") {print branch}}' | {
while read branch; do
git fetch origin $branch
author=$(git log origin/$branch --format="%an" -n 1)
branchTxt='*'$branch'*, last committer: *'$author'*'
printf '%s\n' "${textArray[@]}" > branchtmp.out
text=$(cat branchtmp.out)
rm branchtmp.out
sendSlackMsg "#engineering" "$text"

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.