From e3967a98e397dfce2c98590cd9c02f2e59578cc7 Mon Sep 17 00:00:00 2001 From: bashbunni Date: Tue, 23 Jul 2024 07:11:10 -0700 Subject: [PATCH] feat: add recentCreatedRepos --- main.go | 4 ++-- repos.go | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index f11a42a..3905dd6 100644 --- a/main.go +++ b/main.go @@ -41,10 +41,10 @@ func main() { /* Github */ funcMap["recentContributions"] = recentContributions funcMap["recentPullRequests"] = recentPullRequests - funcMap["recentRepos"] = recentRepos + funcMap["recentCreatedRepos"] = recentCreatedRepos + funcMap["recentPushedRepos"] = recentPushedRepos funcMap["recentForks"] = recentForks funcMap["recentReleases"] = recentReleases - funcMap["recentPushes"] = recentPushes funcMap["followers"] = recentFollowers funcMap["recentStars"] = recentStars funcMap["gists"] = gists diff --git a/repos.go b/repos.go index 39ac018..0954226 100644 --- a/repos.go +++ b/repos.go @@ -164,9 +164,7 @@ func recentPullRequests(count int) []PullRequest { return pullRequests } -func recentRepos(count int) []Repo { - // fmt.Printf("Finding recently created repos...\n") - +func recentCreatedRepos(count int) []Repo { var repos []Repo variables := map[string]interface{}{ "username": githubv4.String(username), @@ -303,7 +301,7 @@ func recentReleases(count int) []Repo { } } */ -func recentPushes(owner string, count int) []Repo { +func recentPushedRepos(owner string, count int) []Repo { var query struct { Owner struct { Repositories struct { @@ -313,7 +311,7 @@ func recentPushes(owner string, count int) []Repo { } `graphql:"repositories(first: $count, privacy: PUBLIC, orderBy: {field: PUSHED_AT, direction: DESC})"` } `graphql:"repositoryOwner(login: $owner)"` } - fmt.Printf("Finding repos with recent pushes in the %s org\n", owner) + fmt.Printf("Finding repos with recent pushes owned by %s\n", owner) var repos []Repo variables := map[string]interface{}{ "count": githubv4.Int(count), @@ -325,7 +323,6 @@ func recentPushes(owner string, count int) []Repo { } for _, v := range query.Owner.Repositories.Edges { - // ignore meta-repo repos = append(repos, repoFromQL(v.Node)) if len(repos) == count { break