소스 검색

Merge branch 'beta.3.github-actions-ci' of https://github.com/porter-dev/porter into sean-testing

Sean Rhee 5 년 전
부모
커밋
654226eee4
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 2
      server/api/git_repo_handler.go
  2. 2 2
      server/router/router.go

+ 4 - 2
server/api/git_repo_handler.go

@@ -98,12 +98,13 @@ func (app *App) HandleGetBranches(w http.ResponseWriter, r *http.Request) {
 		return
 		return
 	}
 	}
 
 
+	owner := chi.URLParam(r, "owner")
 	name := chi.URLParam(r, "name")
 	name := chi.URLParam(r, "name")
 
 
 	client := github.NewClient(app.GithubConf.Client(oauth2.NoContext, tok))
 	client := github.NewClient(app.GithubConf.Client(oauth2.NoContext, tok))
 
 
 	// List all branches for a specified repo
 	// List all branches for a specified repo
-	branches, _, err := client.Repositories.ListBranches(context.Background(), "", name, nil)
+	branches, _, err := client.Repositories.ListBranches(context.Background(), owner, name, nil)
 	if err != nil {
 	if err != nil {
 		fmt.Println(err)
 		fmt.Println(err)
 		return
 		return
@@ -134,12 +135,13 @@ func (app *App) HandleGetBranchContents(w http.ResponseWriter, r *http.Request)
 		return
 		return
 	}
 	}
 
 
+	owner := chi.URLParam(r, "owner")
 	name := chi.URLParam(r, "name")
 	name := chi.URLParam(r, "name")
 	branch := chi.URLParam(r, "branch")
 	branch := chi.URLParam(r, "branch")
 
 
 	repoContentOptions := github.RepositoryContentGetOptions{}
 	repoContentOptions := github.RepositoryContentGetOptions{}
 	repoContentOptions.Ref = branch
 	repoContentOptions.Ref = branch
-	_, directoryContents, _, err := client.Repositories.GetContents(context.Background(), "", name, queryParams["dir"][0], &repoContentOptions)
+	_, directoryContents, _, err := client.Repositories.GetContents(context.Background(), owner, name, queryParams["dir"][0], &repoContentOptions)
 	if err != nil {
 	if err != nil {
 		app.handleErrorInternal(err, w)
 		app.handleErrorInternal(err, w)
 		return
 		return

+ 2 - 2
server/router/router.go

@@ -936,7 +936,7 @@ func New(a *api.App) *chi.Mux {
 
 
 		r.Method(
 		r.Method(
 			"GET",
 			"GET",
-			"/projects/{project_id}/gitrepos/{git_repo_id}/repos/{kind}/{name}/branches",
+			"/projects/{project_id}/gitrepos/{git_repo_id}/repos/{kind}/{owner}/{name}/branches",
 			auth.DoesUserHaveProjectAccess(
 			auth.DoesUserHaveProjectAccess(
 				auth.DoesUserHaveGitRepoAccess(
 				auth.DoesUserHaveGitRepoAccess(
 					requestlog.NewHandler(a.HandleGetBranches, l),
 					requestlog.NewHandler(a.HandleGetBranches, l),
@@ -950,7 +950,7 @@ func New(a *api.App) *chi.Mux {
 
 
 		r.Method(
 		r.Method(
 			"GET",
 			"GET",
-			"/projects/{project_id}/gitrepos/{git_repo_id}/repos/{kind}/{name}/{branch}/contents",
+			"/projects/{project_id}/gitrepos/{git_repo_id}/repos/{kind}/{owner}/{name}/{branch}/contents",
 			auth.DoesUserHaveProjectAccess(
 			auth.DoesUserHaveProjectAccess(
 				auth.DoesUserHaveGitRepoAccess(
 				auth.DoesUserHaveGitRepoAccess(
 					requestlog.NewHandler(a.HandleGetBranchContents, l),
 					requestlog.NewHandler(a.HandleGetBranchContents, l),