Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/api/handlers/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (h *GitHubHandler) ManifestStart(w http.ResponseWriter, r *http.Request) {
apiURL + "/github/callback", // Needed for manifest redirect
apiURL + "/github/oauth/callback",
},
"setup_url": apiURL + "/v1/github/post-install",
"setup_url": apiURL + "/github/post-install",
"public": false,
"default_permissions": map[string]string{
"contents": "read",
Expand All @@ -158,7 +158,7 @@ func (h *GitHubHandler) ManifestStart(w http.ResponseWriter, r *http.Request) {
// 3. Handle Webhook URL (GitHub rejects 'localhost' in manifest flow)
webhookURL := os.Getenv("GITHUB_WEBHOOK_URL")
if webhookURL == "" {
webhookURL = apiURL + "/v1/github/webhook"
webhookURL = apiURL + "/github/webhook"
}

// Only include hook_attributes and events if the URL appears publicly reachable
Expand Down
10 changes: 3 additions & 7 deletions internal/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,8 @@ func (s *Server) setupRouter() {
githubHandler := handlers.NewGitHubHandler(s.store, s.logger)
r.Get("/github/callback", githubHandler.ManifestCallback)
r.Get("/github/oauth/callback", githubHandler.OAuthCallback)

// GitHub post-installation (public - called by GitHub after app install)
r.Route("/v1/github", func(r chi.Router) {
r.Get("/post-install", githubHandler.PostInstallation)
r.Get("/webhook", githubHandler.Webhook)
})
r.Get("/github/post-install", githubHandler.PostInstallation)
r.Post("/github/webhook", githubHandler.Webhook)

// API v1 routes
r.Route("/v1", func(r chi.Router) {
Expand Down Expand Up @@ -272,7 +268,7 @@ func (s *Server) setupRouter() {
})
})

// GitHub routes
// GitHub routes (under /v1 for consistency)
r.Route("/github", func(r chi.Router) {
r.Get("/setup", githubHandler.ManifestStart)
r.Post("/config", githubHandler.SaveConfigManual)
Expand Down