func (_ Github) NewClient() (Client, error) {
	ctx := context.Background()
	ts := oauth2.StaticTokenSource(
		&oauth2.Token{AccessToken: os.Getenv("GHORG_GITHUB_TOKEN")},
	)
	tc := oauth2.NewClient(ctx, ts)
	c := github.NewClient(tc)
	client := Github{Client: c, perPage: 100}
	return client, nil
}
NewClient create new github scm client
package scm
import (
	"context"
	"net/url"
	"os"
	"strings"
	"github.com/google/go-github/v32/github"
	"golang.org/x/oauth2"
)
var (
	_ Client = Github{}
)
func init() {
	registerClient(Github{})
}
type Github struct {
	*github.Client
	perPage int
}
func (_ Github) GetType() string {
	return "github"
}
func (c Github) GetOrgRepos(targetOrg string) ([]Repo, error) {
	if os.Getenv("GHORG_SCM_BASE_URL") != "" {
		c.BaseURL, _ = url.Parse(os.Getenv("GHORG_SCM_BASE_URL"))
	}
	opt := &github.RepositoryListByOrgOptions{
		Type:        "all",
		ListOptions: github.ListOptions{PerPage: c.perPage},
	}
	envTopics := strings.Split(os.Getenv("GHORG_TOPICS"), ",")
	var allRepos []*github.Repository
	for {
		repos, resp, err := c.Repositories.ListByOrg(context.Background(), targetOrg, opt)
		if err != nil {
			return nil, err
		}
		allRepos = append(allRepos, repos...)
		if resp.NextPage == 0 {
			break
		}
		opt.Page = resp.NextPage
	}
	return c.filter(allRepos, envTopics), nil
}
func (c Github) GetUserRepos(targetUser string) ([]Repo, error) {
	if os.Getenv("GHORG_SCM_BASE_URL") != "" {
		c.BaseURL, _ = url.Parse(os.Getenv("GHORG_SCM_BASE_URL"))
	}
	opt := &github.RepositoryListOptions{
		Visibility:  "all",
		ListOptions: github.ListOptions{PerPage: c.perPage},
	}
	envTopics := strings.Split(os.Getenv("GHORG_TOPICS"), ",")
	var allRepos []*github.Repository
	for {
		repos, resp, err := c.Repositories.List(context.Background(), targetUser, opt)
		if err != nil {
			return nil, err
		}
		if targetUser == "" {
			userRepos := []*github.Repository{}
			for _, repo := range repos {
				if *repo.Owner.Type == "User" {
					userRepos = append(userRepos, repo)
				}
			}
			repos = userRepos
		}
		allRepos = append(allRepos, repos...)
		if resp.NextPage == 0 {
			break
		}
		opt.Page = resp.NextPage
	}
	return c.filter(allRepos, envTopics), nil
}