Skip to content

Commit

Permalink
add check to return err if git host name is other than github
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Kumar <[email protected]>
  • Loading branch information
AkashKumar7902 committed May 14, 2024
1 parent 1502ec9 commit 1e5f228
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ func GetAllGithubReleases(url string) ([]string, error) {
return nil, err
}

if gitURL.GetHostName() != "github.com" {
return nil, errors.New("only GitHub repositories are currently supported")
}

// Construct initial API URL for the first page
apiBase := fmt.Sprintf("https://api.github.com/repos/%s/%s/releases", gitURL.GetOwnerName(), gitURL.GetRepoName())
apiURL := fmt.Sprintf("%s?per_page=100&page=1", apiBase)
Expand Down

0 comments on commit 1e5f228

Please sign in to comment.