From dee1d4f1a3e7e9ad19b11fd31a760d7df3f4f349 Mon Sep 17 00:00:00 2001 From: package_aggregator Date: Mon, 4 Nov 2024 11:36:53 +0100 Subject: [PATCH 1/2] Fix 'go: download go1.22 for darwin/arm64: toolchain not available' error --- package-aggregator/go.mod | 2 +- package-aggregator/main.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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..4205412 100644 --- a/package-aggregator/main.go +++ b/package-aggregator/main.go @@ -160,7 +160,7 @@ 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) } @@ -185,7 +185,7 @@ 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.Float64Var(&stale, "stale", 24, "time after which a package should be considered stale (even if the run was successful)") flag.Parse() @@ -196,4 +196,4 @@ func config() { os.Exit(1) } githubToken = ghT -} \ No newline at end of file +} From 6384d4ec782e589e90f26ed013e69ee46d12dc79 Mon Sep 17 00:00:00 2001 From: package_aggregator Date: Mon, 4 Nov 2024 11:44:44 +0100 Subject: [PATCH 2/2] wip add option to include --- package-aggregator/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package-aggregator/main.go b/package-aggregator/main.go index 4205412..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 ) @@ -162,6 +162,13 @@ func getPackageRepoNames(client *github.Client, ctx context.Context) []string { // collect the remaining into slice 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 @@ -186,6 +193,7 @@ func config() { 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 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()