webhook creation should be added
This commit is contained in:
@@ -88,6 +88,27 @@ curl -sS -X POST "$GITEA_URL/api/v1/orgs/$GITEA_ORG/repos" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"name\":\"$APP_ID\",\"private\":false,\"auto_init\":false}" >/dev/null || true
|
||||
|
||||
echo "Creating Gitea webhook..."
|
||||
|
||||
curl -sS -X POST \
|
||||
"$GITEA_URL/api/v1/repos/$GITEA_ORG/$APP_ID/hooks" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"type\": \"gitea\",
|
||||
\"active\": true,
|
||||
\"events\": [\"push\"],
|
||||
\"config\": {
|
||||
\"url\": \"$WEBHOOK_INTERNAL_URL\",
|
||||
\"content_type\": \"json\",
|
||||
\"secret\": \"$WEBHOOK_SECRET\"
|
||||
}
|
||||
}" > /tmp/appfactory-create-hook-response.json
|
||||
|
||||
if grep -q '"message"' /tmp/appfactory-create-hook-response.json; then
|
||||
cat /tmp/appfactory-create-hook-response.json
|
||||
fi
|
||||
|
||||
if [[ "$GITEA_URL" == http://* ]]; then
|
||||
GITEA_PUSH_URL="${GITEA_URL/http:\/\//http:\/\/${GITEA_TOKEN}@}"
|
||||
elif [[ "$GITEA_URL" == https://* ]]; then
|
||||
|
||||
Reference in New Issue
Block a user