chelnak / gh-changelog

A gh cli extension that will make your changelogs ✨
MIT License
110 stars 4 forks source link

Properly handle a repo with no tags #95

Closed chelnak closed 1 year ago

chelnak commented 1 year ago

Prior to this commit when gh changelog new was executed on a repository with no tags it would cause an index out of range error. This error was not handled and would be displayed to the user.

This commit fixes that by checking the length of the tags slice that is returned from GetTags. If it is 0 then we return an error so that it properly bubbles up to the user.