Set a GitHub Personal Access Token as environmental variable to increase rate limit to 5000 per hour:
GITHUB_TOKEN=github_personal_access_token
Spring Boot application to fetch all non-fork GitHub repositories of a user along with their branches and latest commit SHA.
- Java 24
- Maven
- Clone this repository
- Run
./mvnw spring-boot:run - Access API at:
http://localhost:8080/api/v1/github/{username}/repositories
[
{
"name": "example-repo",
"ownerLogin": "username",
"branches": [
{
"name": "main",
"lastCommitSha": "abc123def456"
}
]
}
]
{
"status": 404,
"message": "User not found"
}
Run ./mvnw test to execute the integration test.