From d05fa4c63e130fd035d61698d5633ae871ed858b Mon Sep 17 00:00:00 2001 From: Jiri Uhlir Date: Wed, 20 May 2026 13:06:13 +0200 Subject: [PATCH] Create webhook for generated apps --- scripts/new-python-app.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/new-python-app.sh b/scripts/new-python-app.sh index 3cbf627..61c3b47 100755 --- a/scripts/new-python-app.sh +++ b/scripts/new-python-app.sh @@ -89,6 +89,27 @@ if grep -q '"message"' /tmp/appfactory-create-repo-response.json; then cat /tmp/appfactory-create-repo-response.json fi +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 + git init git branch -M main git remote add origin "$GITEA_URL/$GITEA_ORG/$APP_ID.git"