X Tutup
The Wayback Machine - https://web.archive.org/web/20200918071650/https://github.com/KnpLabs/php-github-api/pull/915
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix call to test a webhook method #915

Open
wants to merge 2 commits into
base: 2.x
from

Conversation

@morrislaptop
Copy link

morrislaptop commented Aug 2, 2020

See renamed URL in the note at https://docs.github.com/en/rest/reference/repos#test-the-push-repository-webhook

Using old URL gives an error "Resource not accessible by integration"

morrislaptop added 2 commits Aug 2, 2020
@GrahamCampbell
Copy link
Contributor

GrahamCampbell commented Aug 2, 2020

Interesting. Are you calling this from a "GitHub app" or an "OAuth app". Do you know what version of GitHub Enterprise supports the new endpoint. Changing this could break things for those users.

@morrislaptop
Copy link
Author

morrislaptop commented Aug 3, 2020

@acrobat
Copy link
Collaborator

acrobat commented Aug 11, 2020

I think we can safely apply this change, as in the github enterprise 2.18 docs the endpoint url is also like the note indicates

{
   "/repos/{owner}/{repo}/hooks/{hook_id}/tests":{
      "post":{
         "summary":"Test the push repository webhook",
         "description":"This will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.\n\n**Note**: Previously `/repos/:owner/:repo/hooks/:hook_id/test`",
         "tags":[
            "repos"
         ],
         "operationId":"repos/test-push-webhook",
         "externalDocs":{
            "description":"API method documentation",
            "url":"https://developer.github.com/enterprise/2.18/v3/repos/hooks/#test-the-push-repository-webhook"
         },
         "parameters":[
            {
               "$ref":"#/components/parameters/owner"
            },
            {
               "$ref":"#/components/parameters/repo"
            },
            {
               "$ref":"#/components/parameters/hook-id"
            }
         ],
         "responses":{
            "204":{
               "description":"Empty response"
            },
            "404":{
               "$ref":"#/components/responses/not_found"
            }
         },
         "x-github":{
            "githubCloudOnly":false,
            "enabledForGitHubApps":true,
            "previews":[

            ]
         }
      }
   }
}

https://github.com/github/rest-api-description/blob/main/descriptions/ghes-2.18/ghes-2.18.json

What do you think @GrahamCampbell?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.
X Tutup