Get User Repositories
Headers
string
required
Bearer token for authentication
Response
array
Array of GitHub repositories accessible to the user
Implementation Details
Authentication Requirements
- User must be authenticated via GitHub OAuth
- The user’s
providerfield must be set togithub - Requires a valid
githubAccessTokenstored in the user’s profile
GitHub API Integration
- Makes a request to
https://api.github.com/user/repos - Uses the stored GitHub access token for authorization
- Includes
Accept: application/vnd.github+jsonheader for GitHub API v3
Query Parameters
The endpoint queries GitHub with the following parameters:string
default:"all"
Returns both public and private repositories
string
default:"owner,collaborator"
Returns repositories the user owns or collaborates on
number
default:"100"
Maximum number of repositories to return (100 is GitHub’s limit per page)
User Model Fields
The implementation uses the following fields from the User model:Use Cases
- Display available repositories for deployment selection
- Allow users to connect their GitHub projects to DeployHub
- Filter repositories for deployment configuration
- Show repository metadata during project creation
Error Responses
github.
GitHub OAuth Scopes
The GitHub OAuth integration requires the following scopes:repo- Full control of private repositoriesuser:email- Access user email addressesadmin:repo_hook- Repository webhooks for deployment triggers