1
1
mirror of https://github.com/cooperspencer/gickup synced 2024-09-08 03:50:36 +02:00

debug msgs and check if pushedat is nil (#227)

This commit is contained in:
Andreas Wachter 2024-04-15 08:09:38 +02:00 committed by GitHub
parent 6a293dd625
commit a62270dee5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 16 additions and 7 deletions

View File

@ -59,6 +59,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
exclude := types.GetMap(repo.Exclude)
for _, r := range repositories.Items {
sub.Debug().Msg(r.Links["clone"].([]interface{})[0].(map[string]interface{})["href"].(string))
user := repo.User
if r.Owner != nil {
if _, ok := r.Owner["nickname"]; ok {

View File

@ -295,6 +295,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
}
if len(repo.Filter.Languages) > 0 {
sub.Debug().Msg(r.HTMLURL)
langs, _, err := client.GetRepoLanguages(r.Owner.UserName, r.Name)
if err != nil {
sub.Error().

View File

@ -219,6 +219,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
languages := types.GetMap(repo.Filter.Languages)
for _, r := range githubrepos {
sub.Debug().Msg(*r.CloneURL)
if repo.Filter.ExcludeForks {
if *r.Fork {
continue
@ -241,6 +242,9 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
if *r.StargazersCount < repo.Filter.Stars {
continue
}
if r.PushedAt == nil {
continue
}
if time.Since(r.PushedAt.Time) > repo.Filter.LastActivityDuration && repo.Filter.LastActivityDuration != 0 {
continue
}

View File

@ -203,6 +203,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
}
if len(repo.Filter.Languages) > 0 {
sub.Debug().Msg(r.WebURL)
langs, _, err := client.Projects.GetProjectLanguages(r.ID)
if err != nil {
sub.Error().

View File

@ -172,6 +172,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
excludeorgs := types.GetMap(repo.ExcludeOrgs)
for _, r := range gogsrepos {
sub.Debug().Msg(r.HTMLURL)
if repo.Filter.ExcludeForks {
if r.Fork {
continue

View File

@ -84,6 +84,13 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
}
for _, r := range userrepos {
urls, _, err := client.GetCloneUrl(r.ID)
if err != nil {
sub.Error().
Msg("couldn't get clone urls")
continue
}
sub.Debug().Msg(urls.HTTP)
if repo.Filter.ExcludeForks {
if r.ForkedFromID != 0 {
continue
@ -98,13 +105,6 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
}
}
urls, _, err := client.GetCloneUrl(r.ID)
if err != nil {
sub.Error().
Msg("couldn't get clone urls")
continue
}
defaultbranch, _, err := client.GetDefaultBranch(r.ID)
if err != nil {
sub.Error().

View File

@ -203,6 +203,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
for _, r := range repositories.Results {
repoURL := fmt.Sprintf("%s%s/%s", repo.URL, repo.User, r.Name)
sshURL := fmt.Sprintf("git@%s:%s/%s", types.GetHost(repo.URL), r.Owner.CanonicalName, r.Name)
sub.Debug().Msg(repoURL)
refs, err := getRefs(apiURL, r.Name, token)
if err != nil {