Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include-file #7

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-aggregator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ require (

require github.com/google/go-querystring v1.1.0 // indirect

go 1.22
go 1.22.0
16 changes: 12 additions & 4 deletions package-aggregator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

var (
outFileName, githubToken, orga, prefix, workflowfile, exclude string
outFileName, githubToken, orga, prefix, workflowfile, exclude, include string
stale float64
)

Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand All @@ -196,4 +204,4 @@ func config() {
os.Exit(1)
}
githubToken = ghT
}
}