Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mohaijiang committed Mar 11, 2024
1 parent eaef961 commit b8753ab
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/service/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,17 @@ func (p *ProjectService) GetProjects(userId int, keyword string, page, size, pro
}

// branches

githubService := application.GetBean[*GithubService]("githubService")
ctx, _ := context.WithTimeout(context.Background(), time.Second*20)
owner, repo, err := ParsingGitHubURL(data.RepositoryUrl)
if err != nil {
data.AllBranch = []string{data.Branch}
} else {
branches, err2 := githubService.ListRepositoryBranch(ctx, owner, repo)
if err2 != nil {
data.AllBranch = []string{data.Branch}
}
data.AllBranch = branches
} else {
data.AllBranch = []string{data.Branch}
}

//recentDeploy
Expand Down

0 comments on commit b8753ab

Please sign in to comment.