Skip to content

Commit

Permalink
bug #1056 fix(Apps): use /orgs/ORG/installation (ellisio)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.4.x-dev branch.

Discussion
----------

According to [the documentation](https://docs.github.com/en/rest/reference/apps#get-an-organization-installation-for-the-authenticated-app) this should be `/orgs/ORG/installation`, not `/org/ORG/installation`.

Using the singular version results in `Bad credentials` when using a valid JWT for the GitHub App.

Commits
-------

4d53365 fix(Apps): use /orgs/ORG/installation
  • Loading branch information
acrobat committed Mar 24, 2022
2 parents c258cc0 + 4d53365 commit 4f7d08d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Github/Api/Apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function getInstallationForOrganization($org)
{
$this->configurePreviewHeader();

return $this->get('/org/'.rawurldecode($org).'/installation');
return $this->get('/orgs/'.rawurldecode($org).'/installation');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/Github/Tests/Api/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function shouldGetInstallationForOrganization()
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('/org/1234/installation')
->with('/orgs/1234/installation')
->willReturn($result);

$this->assertEquals($result, $api->getInstallationForOrganization('1234'));
Expand Down

0 comments on commit 4f7d08d

Please sign in to comment.