mirror of
https://github.com/hanzoai/deploy.git
synced 2026-10-07 08:44:50 +00:00
Signed-off-by: reggie-k <[email protected]> Signed-off-by: Regina Voloshin <[email protected]> Co-authored-by: Alexandre Gaudreault <[email protected]>
19 lines
708 B
Go
19 lines
708 B
Go
package scm_provider
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/argoproj/argo-cd/v3/applicationset/services/github_app_auth"
|
|
"github.com/argoproj/argo-cd/v3/applicationset/services/internal/github_app"
|
|
appsetutils "github.com/argoproj/argo-cd/v3/applicationset/utils"
|
|
)
|
|
|
|
func NewGithubAppProviderFor(g github_app_auth.Authentication, organization string, url string, allBranches bool, optionalHTTPClient ...*http.Client) (*GithubProvider, error) {
|
|
httpClient := appsetutils.GetOptionalHTTPClient(optionalHTTPClient...)
|
|
client, err := github_app.Client(g, url, httpClient)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &GithubProvider{client: client, organization: organization, allBranches: allBranches}, nil
|
|
}
|