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:runThe application will start on http://localhost:8080 by default.
./mvnw testGET /api/github/{username}/repositories
[
{
"repositoryName": "Hello-World",
"ownerLogin": "octocat",
"branches": [
{
"name": "main",
"lastCommitSha": "7fd1a60..."
}
]
}
]{
"status": "error",
"message": "User not found: {username}"
}