From 23d851aff066a39e3ceb01f85c30539e467a70ea Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Tue, 15 Mar 2016 16:41:58 +0200 Subject: Add support for github secrets --- request.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'request.sh') diff --git a/request.sh b/request.sh index f118034..61864e7 100755 --- a/request.sh +++ b/request.sh @@ -1,3 +1,12 @@ #!/usr/bin/env bash -curl --data "payload=`cat $1`" http://localhost:8093/ +DATA="payload=`cat $1`" + +echo $DATA + +hash=$(echo -n "$DATA" | openssl dgst -sha1 -hmac "$2" | awk '{print $2}') +echo $hash + +echo -n "$DATA" > ~/repos/supybot-github/cmpr + +curl --header "X-GitHub-Event: $1" --header "X-Hub-Signature: sha1=$hash" --data "$DATA" http://localhost:8093/ -- cgit v1.2.3