Skip to content

Commit

Permalink
updates bootstrap github-app cmd to check if webhook is already confi…
Browse files Browse the repository at this point in the history
…gured
  • Loading branch information
Shivam Mukhade committed Apr 20, 2022
1 parent 413cdba commit 077f74a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/cmd/tknpac/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ func GithubApp(run *params.Run, ioStreams *cli.IOStreams) *cobra.Command {
return err
}

pacInfo, err := info.GetPACInfo(ctx, run, opts.targetNamespace)
if err != nil {
return err
}

if pacInfo.Provider != "" && pacInfo.Provider != provider.ProviderGitHubApp {
return fmt.Errorf("skipping bootstraping GitHub App, %s is already configured", pacInfo.Provider)
}

if b, _ := askYN(false, "", "Are you using Github Enterprise?"); b {
opts.providerType = "github-enterprise-app"
}
Expand Down

0 comments on commit 077f74a

Please sign in to comment.