Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.

Commit 9aaec21

Browse files
committed
Added better logging
1 parent 173d312 commit 9aaec21

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/hiring_unseat.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,21 @@ func RunUnseat(opts *UnseatOpts) error {
5959
return errors.New("Please provide an organization")
6060
}
6161

62+
log.Info("Fetching repositories...")
6263
allRepos, err := fetchAllRepos(org, opts.ReposPerPage, opts.Page)
6364
if err != nil {
6465
return errors.Wrap(err, "Could not retrieve repositories")
6566
}
67+
log.Infof("%d repositories fetched!", len(allRepos))
6668

69+
log.Info("Removing outside colaborators...")
6770
for _, repo := range allRepos {
6871
if isRepoInactive(repo) {
6972
continue
7073
}
7174

7275
repoName := *repo.Name
73-
log.WithField("repo", repoName).Info("Fetching outside collaborators")
76+
log.WithField("repo", repoName).Debug("Fetching outside collaborators")
7477
outsideCollaborators, _, err := githubClient.Repositories.ListCollaborators(ctx, org, repoName, &github.ListCollaboratorsOptions{
7578
Affiliation: "outside",
7679
})
@@ -104,7 +107,7 @@ func fetchAllRepos(owner string, reposPerPage int, page int) ([]*github.Reposito
104107
}
105108

106109
for {
107-
log.Infof("Fetching repositories page [%d]", opt.Page)
110+
log.Debugf("Fetching repositories page [%d]", opt.Page)
108111
repos, resp, err := githubClient.Repositories.ListByOrg(context.Background(), owner, opt)
109112
if err != nil {
110113
return allRepos, err

0 commit comments

Comments
 (0)