webhook creation should be added

This commit is contained in:
2026-06-15 06:51:51 +00:00
parent d57f191ded
commit 3c3a2b7eb6
4 changed files with 84 additions and 0 deletions
+21
View File
@@ -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