mirror of https://git.kore.io/kore.git
Version control the post-receive githook.
This commit is contained in:
parent
4ecd6d5603
commit
7632705c64
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/local/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
URL=discord-hook
|
||||||
|
|
||||||
|
while read oldrev newrev ref; do
|
||||||
|
if [[ $ref =~ .*/master$ ]]; then
|
||||||
|
logmsg=""
|
||||||
|
commits=$(git rev-list ${oldrev}..${newrev})
|
||||||
|
for commit in $commits; do
|
||||||
|
log=$(git log -1 --pretty=format:'[%h](https://github.com/jorisvink/kore/commit/%H) %cn: %s' $commit)
|
||||||
|
logmsg="$logmsg $log\\n"
|
||||||
|
done
|
||||||
|
|
||||||
|
curl -i \
|
||||||
|
-H "Accept: application/json" \
|
||||||
|
-H "Content-type: application/json" \
|
||||||
|
-X POST \
|
||||||
|
-d "{\"content\": \"${logmsg}\"}" \
|
||||||
|
$URL
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Reference in New Issue