Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cmd/hiring_send.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ func RunCreateTestRepo(ctx context.Context, candidate string, testRepo string, r
target := fmt.Sprintf("%s-%s", candidate, testRepo)

creator := repo.NewGithub(githubClient)

logger.Info("Creating repository...")
logger.Infof("Creating repository %s/%s...", org, target)
_, err = creator.CreateRepo(ctx, org, &github.Repository{
Name: github.String(target),
Private: github.Bool(true),
Expand All @@ -84,7 +83,7 @@ func RunCreateTestRepo(ctx context.Context, candidate string, testRepo string, r
return errwrap.Wrapf("could not create github repo for candidate: {{err}}", err)
}

logger.Info("Adding collaborators to repository...")
logger.Infof("Adding %s as collaborator to %s/%s", candidate, org, target)
collaboratorsOpts := []*config.Collaborator{
&config.Collaborator{
Username: candidate,
Expand All @@ -106,12 +105,16 @@ func RunCreateTestRepo(ctx context.Context, candidate string, testRepo string, r
return errwrap.Wrapf("error cloning to repository: {{err}}", err)
}

logger.Debugf("Repository %s/%s cloned", org, testRepo)

logger.Info("Changing remote...")
remote, err := r.Remote(git.DefaultRemoteName)
if err != nil {
return errwrap.Wrapf("error changing remote for repository: {{err}}", err)
}

logger.Debugf("Remote on %s/%s changed to %s", org, testRepo, git.DefaultRemoteName)

logger.Info("Pushing changes...")
remote.Config().URLs = []string{fmt.Sprintf("https://%s@github.com/%s/%s", cfg.GithubTestOrg.Token, org, target)}
err = remote.Push(&git.PushOptions{
Expand Down
12 changes: 11 additions & 1 deletion cmd/repo_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"context"
"errors"
"strconv"

"github.com/hellofresh/github-cli/pkg/zappr"

Expand Down Expand Up @@ -86,6 +87,15 @@ func RunCreateRepo(ctx context.Context, repoName string, opts *CreateRepoOptions
return errors.New("please provide an organization")
}

logger.Debug("Create options:")
logger.Debugf("\tConfigure PullApprove? %s", strconv.FormatBool(opts.HasPullApprove))
logger.Debugf("\tConfigure Zappr? %s", strconv.FormatBool(opts.HasZappr))
logger.Debugf("\tConfigure GitHub teams? %s", strconv.FormatBool(opts.HasTeams))
logger.Debugf("\tConfigure collaborators? %s", strconv.FormatBool(opts.HasCollaborators))
logger.Debugf("\tAdd labels to repository? %s", strconv.FormatBool(opts.HasLabels))
logger.Debugf("\tAdd webhooks to repository? %s", strconv.FormatBool(opts.HasWebhooks))
logger.Debugf("\tConfigure branch protection? %s", strconv.FormatBool(opts.HasBranchProtections))

description := opts.Description
githubOpts := &repo.GithubRepoOpts{
PullApprove: &repo.PullApproveOpts{
Expand All @@ -104,7 +114,7 @@ func RunCreateRepo(ctx context.Context, repoName string, opts *CreateRepoOptions

creator := repo.NewGithub(githubClient)

logger.Info("Creating repository...")
logger.Infof("Creating repository %s/%s...", org, repoName)
ghRepo, err := creator.CreateRepo(ctx, org, &github.Repository{
Name: github.String(repoName),
Description: github.String(description),
Expand Down