REST API that fetches non-fork GitHub repositories for a given user and includes the branches with latest commit SHA.
- Java 21 or higher (LTS version recommended)
- Maven 3.3.2 or higher
git clone https://github.com/KalbarczykDev/GithubRepositoriesService.git
cd GithubRepositoriesService
./mvnw clean install
./mvnw spring-boot:run
The application will start on http://localhost:8080 by default.
./mvnw test
GET /api/github/{username}/repositories
[
{
"repositoryName": "Hello-World",
"ownerLogin": "octocat",
"branches": [
{
"name": "main",
"lastCommitSha": "7fd1a60..."
}
]
}
]
{
"status": "error",
"message": "User not found: {username}"
}