Skip to content

Commit 354034b

Browse files
authored
use hostname in both github and caching (#1831)
1 parent 467d0ae commit 354034b

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

backend/controllers/cache.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,9 @@ func (d DiggerController) UpdateRepoCache(c *gin.Context) {
5252
return
5353
}
5454

55-
cloneUrl := repo.RepoUrl
55+
cloneUrl := fmt.Sprintf("https://%v/%v", utils.GetGithubHostname(), repo.RepoFullName)
5656
branch := request.Branch
5757

58-
//ghInstallation, err := models.DB.GetInstallationForRepo(repoFullName)
59-
//if err != nil {
60-
// log.Printf("could not get repo: %v", err)
61-
// c.String(500, fmt.Sprintf("coulnt not get repository %v %v", repoFullName, orgId))
62-
// return
63-
//}
64-
6558
_, token, err := utils.GetGithubService(d.GithubClientProvider, installationId, repoFullName, repoOwner, repoName)
6659
if err != nil {
6760
log.Printf("could not get github service :%v", err)

backend/controllers/github.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ func (d DiggerController) GithubAppCallbackPage(c *gin.Context) {
11631163
repoFullName := *repo.FullName
11641164
repoOwner := strings.Split(*repo.FullName, "/")[0]
11651165
repoName := *repo.Name
1166-
repoUrl := fmt.Sprintf("https://github.com/%v", repoFullName)
1166+
repoUrl := fmt.Sprintf("https://%v/%v", utils.GetGithubHostname(), repoFullName)
11671167
_, err := models.DB.GithubRepoAdded(installationId64, *installation.AppID, *installation.Account.Login, *installation.Account.ID, repoFullName)
11681168
if err != nil {
11691169
log.Printf("github repos added error: %v", err)

0 commit comments

Comments
 (0)