Skip to content

Commit

Permalink
fix(publish): improve error message when no tags found (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardcooke53 committed Aug 13, 2023
1 parent 5981a45 commit bdc06ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion semantic_release/cli/commands/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ def publish(ctx: click.Context, tag: str = "latest") -> None:
dist_glob_patterns = runtime.dist_glob_patterns

if tag == "latest":
tag = str(tags_and_versions(repo.tags, translator)[0][0])
try:
tag = str(tags_and_versions(repo.tags, translator)[0][0])
except IndexError:
ctx.fail(
f"No tags found with format {translator.tag_format!r}, couldn't "
"identify latest version"
)
if runtime.global_cli_options.noop:
noop_report(
"would have uploaded files matching any of the globs "
Expand Down

0 comments on commit bdc06ea

Please sign in to comment.