I found the endpoint to add a repo to an installation in the Installation section of the docs for GitHub Apps. I’m a bit confused with the use case for that endpoint.
At first, I thought that the endpoint was intended for the app, so an authenticated user could add a repo to the installation. Ideally, the app would show a list of repos so the user could add them to the app, something like:
Add repos to MyApp repo-a ✓ repo-b ✓ repo-c X [ Grant access ]
but then, I don’t know how this could work, as the app doesn’t have access to
repo-c (even with user-to-server request).
My next guess was that an OAuth app could make that request on behalf of the user, but in that case, would it make sense to create an OAuth app only so the users can use it to add repos to a different app?
Can I get some clarification around the intended use case for this endpoint? Are my assumptions correct on that an app cannot get a list of repos for which it doesn’t have access, even with user-to-server requests?