Skip to content

Commit

Permalink
feat: add recentCreatedRepos
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbunni committed Jul 23, 2024
1 parent 3728b5f commit e3967a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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 {
Expand All @@ -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

Check failure on line 315 in repos.go

View workflow job for this annotation

GitHub Actions / lint-soft

Consider pre-allocating `repos` (prealloc)
variables := map[string]interface{}{
"count": githubv4.Int(count),
Expand All @@ -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
Expand Down

0 comments on commit e3967a9

Please sign in to comment.