Skip to content

feat: fetch and automatically pre-select default branch for GitHub repositories#84

Open
igor-soldev wants to merge 2 commits into
SolDevelo:mainfrom
igor-soldev:main
Open

feat: fetch and automatically pre-select default branch for GitHub repositories#84
igor-soldev wants to merge 2 commits into
SolDevelo:mainfrom
igor-soldev:main

Conversation

@igor-soldev
Copy link
Copy Markdown
Member

Summary

This PR adds automatic detection and pre-selection of the default branch for GitHub repositories in the InfraScan UI.

When a user pastes a GitHub repository URL, the backend now queries the GitHub REST API to retrieve the repository's default_branch. The frontend then automatically selects this branch in the branch dropdown.

Changes

  • Added GitHub repository URL detection in /api/repo/branches
  • Fetch repository metadata from the GitHub API
  • Return default_branch in the API response
  • Promote the actual default branch to the top of the branch list
  • Automatically pre-select the default branch in the UI
  • Preserve existing fallback behavior for non-GitHub repositories (main / master)

Closes #81

@igor-soldev igor-soldev requested a review from jkondrat May 29, 2026 06:13
@igor-soldev igor-soldev added the enhancement New feature or request label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infrascan UI - select GitHub default branch

2 participants