mirror of
https://github.com/Luzifer/repo-template.git
synced 2024-11-10 00:20:03 +00:00
Add filter for archived repos
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
46c353bbec
commit
84dcf96209
1 changed files with 3 additions and 0 deletions
|
@ -10,11 +10,14 @@ import (
|
|||
type filterFunc func(*github.Repository) bool
|
||||
|
||||
var filters = map[string]filterFunc{
|
||||
"archived": filterArchived,
|
||||
"fork": filterFork,
|
||||
"dockerfile": filterDockerfile,
|
||||
"public": filterPublic,
|
||||
}
|
||||
|
||||
func filterArchived(repo *github.Repository) bool { return repo.Archived != nil && *repo.Archived }
|
||||
|
||||
func filterDockerfile(repo *github.Repository) bool {
|
||||
ctx := context.Background()
|
||||
_, _, resp, err := client.Repositories.GetContents(ctx, *repo.Owner.Login, *repo.Name, "Dockerfile", nil)
|
||||
|
|
Loading…
Reference in a new issue