Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 4cb0578

Browse files
authored
Merge pull request #310 from secrethub/feature/link-check-ns
Directly check if repo exists
2 parents fced7b5 + d058990 commit 4cb0578

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

internals/secrethub/service_gcp_init.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ func (cmd *ServiceGCPInitCommand) Run() error {
5050
return err
5151
}
5252

53+
// Fail fast if the repo does not exist.
54+
_, err = client.Repos().Get(cmd.repo.String())
55+
if err != nil {
56+
return err
57+
}
58+
5359
if cmd.serviceAccountEmail == "" && cmd.kmsKeyResourceID == "" {
5460
fmt.Fprintln(cmd.io.Stdout(), "This command creates a new service account for use on GCP. For help on this, run `secrethub service gcp init --help`.")
5561

0 commit comments

Comments
 (0)