From 4c0a44979ff2f3d915da548c231da76bc9a80ee9 Mon Sep 17 00:00:00 2001 From: Petr Stroganov Date: Sat, 14 May 2022 06:36:36 +0900 Subject: [PATCH] Add missing CleanedBasePath to GithubSetupData created by GithubAppController (#2142) --- server/controllers/github_app_controller.go | 13 +++++++------ server/controllers/templates/web_templates.go | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/server/controllers/github_app_controller.go b/server/controllers/github_app_controller.go index d8808cd83..11e886309 100644 --- a/server/controllers/github_app_controller.go +++ b/server/controllers/github_app_controller.go @@ -70,12 +70,13 @@ func (g *GithubAppController) ExchangeCode(w http.ResponseWriter, r *http.Reques g.Logger.Debug("Found credentials for GitHub app %q with id %d", app.Name, app.ID) err = templates.GithubAppSetupTemplate.Execute(w, templates.GithubSetupData{ - Target: "", - Manifest: "", - ID: app.ID, - Key: app.Key, - WebhookSecret: app.WebhookSecret, - URL: app.URL, + Target: "", + Manifest: "", + ID: app.ID, + Key: app.Key, + WebhookSecret: app.WebhookSecret, + URL: app.URL, + CleanedBasePath: g.AtlantisURL.Path, }) if err != nil { g.Logger.Err(err.Error()) diff --git a/server/controllers/templates/web_templates.go b/server/controllers/templates/web_templates.go index d7f598d1e..494ca3ed0 100644 --- a/server/controllers/templates/web_templates.go +++ b/server/controllers/templates/web_templates.go @@ -501,12 +501,13 @@ var ProjectJobsErrorTemplate = template.Must(template.New("blank.html.tmpl").Par // GithubSetupData holds the data for rendering the github app setup page type GithubSetupData struct { - Target string - Manifest string - ID int64 - Key string - WebhookSecret string - URL string + Target string + Manifest string + ID int64 + Key string + WebhookSecret string + URL string + CleanedBasePath string } var GithubAppSetupTemplate = template.Must(template.New("github-app.html.tmpl").Parse(`