Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat(pre-commit): automate generation of service templates and OpenAPI documentation during pre-commit hook

Andras Bacsaid9a54145ef3c
diff --git a/hooks/pre-commit b/hooks/pre-commit
index 029f679174..fc96e9766a 100644
--- a/hooks/pre-commit
+++ b/hooks/pre-commit
@@ -4,6 +4,19 @@ if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then
exec </dev/tty
fi
+# Generate service templates and OpenAPI documentation
+echo "πŸ”„ Generating service templates..."
+php artisan generate:services
+
+echo "πŸ“š Generating OpenAPI documentation..."
+php artisan generate:openapi
+
+# Add the generated files to the commit
+git add templates/service-templates*.json
+git add openapi.json openapi.yaml
+
+echo "βœ… Generated files have been added to the commit"
+
# Get list of stashed PHP files
stashed_files=$(git diff --cached --name-only --diff-filter=ACM -- '*.php')