From 69adbfec07b703722e62038891679a2a936cfeef Mon Sep 17 00:00:00 2001 From: Marwan Sulaiman Date: Mon, 31 Oct 2022 11:15:13 -0400 Subject: [PATCH] Fix docs + 403 --- webhook/create_webhook.go | 2 +- webhook/forward.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/webhook/create_webhook.go b/webhook/create_webhook.go index aaff395..47b5aff 100644 --- a/webhook/create_webhook.go +++ b/webhook/create_webhook.go @@ -69,7 +69,7 @@ func createHook(o *hookOptions) (string, func() error, error) { err = apiClient.Post(path, bytes.NewReader(reqBytes), &res) if err != nil { var apierr api.HTTPError - if errors.As(err, &apierr) && apierr.StatusCode == http.StatusUnprocessableEntity { + if errors.As(err, &apierr) && apierr.StatusCode == http.StatusForbidden { return "", nil, fmt.Errorf("you do not have access to this feature") } return "", nil, fmt.Errorf("error creating webhook: %w", err) diff --git a/webhook/forward.go b/webhook/forward.go index 22f9735..076d987 100644 --- a/webhook/forward.go +++ b/webhook/forward.go @@ -43,8 +43,8 @@ func NewCmdForward(runF func(*hookOptions) error) *cobra.Command { # create a dev webhook for the 'issue_open' event in the monalisa/smile repo in GitHub running locally, and # forward payloads for the triggered event to http://localhost:9999/webhooks - $ gh webhooks forward --events=issues --repo=monalisa/smile --url="http://localhost:9999/webhooks" - $ gh webhooks forward --events=issues --org=github --url="http://localhost:9999/webhooks" + $ gh webhook forward --events=issues --repo=monalisa/smile --url="http://localhost:9999/webhooks" + $ gh webhook forward --events=issues --org=github --url="http://localhost:9999/webhooks" `), RunE: func(*cobra.Command, []string) error { if opts.EventTypes == nil {