()
| 40 | } |
| 41 | |
| 42 | func (c *GithubConfig) ListRepositories() ([]*Repository, error) { |
| 43 | repos, err := c.getAllRepos() |
| 44 | if err != nil { |
| 45 | return nil, err |
| 46 | } |
| 47 | out := make([]*Repository, 0, len(repos)) |
| 48 | for _, repo := range repos { |
| 49 | if isExcluded(c.Exclude, *repo.FullName) { |
| 50 | log.Printf("Skipping excluded repository: %s", *repo.FullName) |
| 51 | continue |
| 52 | } |
| 53 | |
| 54 | gitUrl, err := url.Parse(*repo.CloneURL) |
| 55 | if err != nil { |
| 56 | return out, err |
| 57 | } |
| 58 | gitUrl.User = url.UserPassword("github", c.AccessToken) |
| 59 | |
| 60 | out = append(out, &Repository{ |
| 61 | FullName: *repo.FullName, |
| 62 | GitURL: *gitUrl, |
| 63 | }) |
| 64 | |
| 65 | } |
| 66 | return out, nil |
| 67 | } |
| 68 | |
| 69 | func (c *GithubConfig) setDefaults() { |
| 70 | if c.JobName == "" { |
nothing calls this directly
no test coverage detected