diff --git a/package-aggregator/go.mod b/package-aggregator/go.mod index dac6a7c..ce0ec00 100644 --- a/package-aggregator/go.mod +++ b/package-aggregator/go.mod @@ -7,4 +7,4 @@ require ( require github.com/google/go-querystring v1.1.0 // indirect -go 1.22 +go 1.22.0 diff --git a/package-aggregator/main.go b/package-aggregator/main.go index b779752..f569c25 100644 --- a/package-aggregator/main.go +++ b/package-aggregator/main.go @@ -14,7 +14,7 @@ import ( ) var ( - outFileName, githubToken, orga, prefix, workflowfile, exclude string + outFileName, githubToken, orga, prefix, workflowfile, exclude, include string stale float64 ) @@ -160,8 +160,15 @@ func getPackageRepoNames(client *github.Client, ctx context.Context) []string { } // collect the remaining into slice - for repo, _ := range prefixRepos { + for repo := range prefixRepos { packageRepos = append(packageRepos, repo) + + println(repo) + } + + // Add repos from the include list + for _, in := range strings.Split(include, ",") { + packageRepos = append(packageRepos, in) } return packageRepos @@ -185,7 +192,8 @@ func config() { flag.StringVar(&orga, "orga", "gardenlinux", "The GitHub organization name to scrape") flag.StringVar(&prefix, "prefix", "package-", "filter the organizations repos by this prefix") flag.StringVar(&workflowfile, "workflowfile", "build.yml", "scrape workflow runs of this file") - flag.StringVar(&exclude, "exclude", "", "a comma seperated list of repositories to exclude from scraping") + flag.StringVar(&exclude, "exclude", "", "a comma separated list of repositories to exclude from scraping") + flag.StringVar(&include, "include", "", "a comma separated list of repositories to include when scraping") flag.Float64Var(&stale, "stale", 24, "time after which a package should be considered stale (even if the run was successful)") flag.Parse() @@ -196,4 +204,4 @@ func config() { os.Exit(1) } githubToken = ghT -} \ No newline at end of file +}