From caf170baafb544dabb50d9160ea35a486382f026 Mon Sep 17 00:00:00 2001 From: Bryan Johnson Date: Thu, 14 Dec 2023 10:03:15 -0500 Subject: [PATCH] Enrich github prompt to capture organization ID for GitHub App integration users --- cmd/orb.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cmd/orb.go b/cmd/orb.go index e77097157..224d0f9d7 100644 --- a/cmd/orb.go +++ b/cmd/orb.go @@ -17,6 +17,12 @@ import ( "strings" "time" + "github.com/fatih/color" + "github.com/pkg/errors" + "github.com/spf13/cobra" + "golang.org/x/exp/slices" + "gopkg.in/yaml.v3" + "github.com/CircleCI-Public/circleci-cli/api" "github.com/CircleCI-Public/circleci-cli/api/collaborators" "github.com/CircleCI-Public/circleci-cli/api/graphql" @@ -28,11 +34,6 @@ import ( "github.com/CircleCI-Public/circleci-cli/settings" "github.com/CircleCI-Public/circleci-cli/telemetry" "github.com/CircleCI-Public/circleci-cli/version" - "github.com/fatih/color" - "github.com/pkg/errors" - "github.com/spf13/cobra" - "golang.org/x/exp/slices" - "gopkg.in/yaml.v3" "github.com/AlecAivazis/survey/v2" "github.com/go-git/go-git/v5" @@ -1301,6 +1302,12 @@ func initOrb(opts orbOptions) error { Message: fmt.Sprintf("Enter your %s username or organization", vcsProvider), Default: opts.cfg.OrbPublishing.DefaultOwner, } + if vcsProvider == "GitHub" { + iprompt = &survey.Input{ + Message: fmt.Sprintf("If your organization is using CircleCI’s GitHub App integration (see %s to check), enter your organization ID found in Organization Settings. If not, enter your organization name as a string.", + "https://circleci.com/docs/github-apps-integration/"), + } + } err = survey.AskOne(iprompt, &ownerName) if err != nil { return err