Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SyncCmd = &cobra.Command{ Use: "sync", Short: "Syncs the fork to an upstream ref by appending all the custom commits", RunE: func(cmd *cobra.Command, args []string) error { var err error if len(syncRepoUpstream) == 0 { err = multierror.Append(fmt.Errorf("must define upstream repository in scan request"), err) } if len(syncRepo) == 0 { err = multierror.Append(fmt.Errorf("must define fork's repository in scan request"), err) } if len(syncHeadUpstream) == 0 { err = multierror.Append(fmt.Errorf("must define upstream head ref in scan request"), err) } if len(syncHead) == 0 { err = multierror.Append(fmt.Errorf("must define fork's head ref in scan request"), err) } if len(syncBranch) == 0 { err = multierror.Append(fmt.Errorf("must define name of the sync branch in fork"), err) } if err != nil { return err } forkOrg, syncRepoName, err := getOrgRepo(syncRepo) if err != nil { return err } upstreamOrg, upstreamRepoName, err := getOrgRepo(syncRepoUpstream) if err != nil { return err } ctx := context.Background() client := utils.GetGithubClient() return sync.Sync( ctx, utils.NewGitHelper(), client, &sync.Request{ DryRun: syncDryRun, OutBranch: syncBranch, UpstreamOrg: upstreamOrg, UpstreamRepo: upstreamRepoName, ForkOrg: forkOrg, ForkRepo: syncRepoName, ForkHeadRef: syncHead, UpstreamHeadRef: syncHeadUpstream, }, ) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.