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

Invalid url for get reference endpoint? #1037

Open
vovayatsyuk opened this issue Nov 11, 2021 · 0 comments
Open

Invalid url for get reference endpoint? #1037

vovayatsyuk opened this issue Nov 11, 2021 · 0 comments

Comments

@vovayatsyuk
Copy link
Contributor

vovayatsyuk commented Nov 11, 2021

While this code works fine for most use cases:

return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/git/refs/'.$reference);

It looks like that GET /refs/{ref} is an undocumented endpoint and it returns an array of references when an exact reference is not found, but other similar references are found in the repo.

Current GitHub docs tells to use GET /ref/{ref} URL: https://docs.github.com/en/rest/reference/git#get-a-reference

My story: I have the following references in the repo:

  • accepted-1-1
  • accepted-1-1-1

When I try to get accepted-1 reference using references()->show(..) I get the following response:

Screenshot 2021-11-11 at 22 15 41

If I change GET /refs/{ref} to GET /ref/{ref} in References.php it starts throwing 404 not found exception.

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

No branches or pull requests

1 participant