mirror of
https://github.com/argoproj/argo-cd
synced 2026-04-21 08:57:17 +00:00
Signed-off-by: Prune <prune@lecentre.net> Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com> Co-authored-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
19 lines
830 B
Go
19 lines
830 B
Go
package scm_provider
|
|
|
|
import (
|
|
"context"
|
|
"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(ctx context.Context, g github_app_auth.Authentication, organization string, url string, allBranches bool, excludeArchivedRepos bool, optionalHTTPClient ...*http.Client) (*GithubProvider, error) {
|
|
httpClient := appsetutils.GetOptionalHTTPClient(optionalHTTPClient...)
|
|
client, err := github_app.Client(ctx, g, url, organization, httpClient)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &GithubProvider{client: client, organization: organization, allBranches: allBranches, excludeArchivedRepos: excludeArchivedRepos}, nil
|
|
}
|