(ctx context.Context, client *github.Client)
| 232 | } |
| 233 | |
| 234 | func (g *githubClient) token(ctx context.Context, client *github.Client) (string, time.Time, error) { |
| 235 | tr, ok := client.Client().Transport.(*ghinstallation.Transport) |
| 236 | if !ok { |
| 237 | return "", time.Time{}, fmt.Errorf("transport is not of type *ghinstallation.Transport") |
| 238 | } |
| 239 | t, err := tr.Token(ctx) |
| 240 | if err != nil { |
| 241 | return "", time.Time{}, err |
| 242 | } |
| 243 | _, expiry, err := tr.Expiry() |
| 244 | if err != nil { |
| 245 | return "", time.Time{}, err |
| 246 | } |
| 247 | return t, expiry, nil |
| 248 | } |
| 249 | |
| 250 | func (s *Service) CreateManagedGitRepo(ctx context.Context, org *database.Organization, name, ownerID string, autoInit bool) (*github.Repository, error) { |
| 251 | if org.QuotaProjects >= 0 { |
no test coverage detected