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
}
GetOrgRepos gets org repos
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"
}