Skip to content

Commit

Permalink
Fix docs + 403
Browse files Browse the repository at this point in the history
  • Loading branch information
marwan-at-work committed Oct 31, 2022
1 parent 63b2243 commit 69adbfe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion webhook/create_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions webhook/forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 69adbfe

Please sign in to comment.