fixed webhook script

This commit is contained in:
jan6 2021-10-10 22:13:10 +03:00
parent 74cdd2311e
commit 0aa5f44217
3 changed files with 11 additions and 7 deletions

View File

@ -1,7 +0,0 @@
#!/bin/sh
printf "Content-Type: text/plain\r\n\r\n"
#env
if [ "$CONTENT_TYPE"="application/json" ] && [ "$HTTP_X_GITEA_EVENT"="push" ];then
echo "rebuilding"
"../build.sh"
fi

1
dist/webhook.cgi vendored Symbolic link
View File

@ -0,0 +1 @@
../webhook.cgi

10
webhook.cgi Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
exec 2>&1
printf "Content-Type: text/plain\r\n\r\n"
#env
if [ -n "$CONTENT_TYPE" ] && [ -n "$HTTP_X_GITEA_EVENT" ] && [ "$CONTENT_TYPE"="application/json" ] && [ "$HTTP_X_GITEA_EVENT"="push" ];then
echo "rebuilding"
../build.sh
else
echo "incorrect data"
fi