File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -336,6 +336,12 @@ def __call__(
336336 "help" : "Add additional build-metadata to the version-number" ,
337337 "default" : None ,
338338 },
339+ {
340+ "name" : ["--empty" ],
341+ "default" : False ,
342+ "help" : "bump tags without new commits" ,
343+ "action" : "store_true" ,
344+ },
339345 ],
340346 },
341347 {
Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ def __call__(self) -> None: # noqa: C901
159159 manual_version = self .arguments ["manual_version" ]
160160 build_metadata = self .arguments ["build_metadata" ]
161161 increment_mode : str = self .arguments ["increment_mode" ]
162+ is_empty : bool | None = self .arguments ["empty" ]
162163
163164 if manual_version :
164165 if increment :
@@ -231,7 +232,7 @@ def __call__(self) -> None: # noqa: C901
231232
232233 # No commits, there is no need to create an empty tag.
233234 # Unless we previously had a prerelease.
234- if not commits and not current_version .is_prerelease :
235+ if not commits and not current_version .is_prerelease and not is_empty :
235236 raise NoCommitsFoundError (
236237 "[NO_COMMITS_FOUND]\n " "No new commits found."
237238 )
@@ -247,6 +248,10 @@ def __call__(self) -> None: # noqa: C901
247248 "To avoid this error, manually specify the type of increment with `--increment`"
248249 )
249250
251+ # we create an empty PATCH increment for empty tag
252+ if increment is None and is_empty :
253+ increment = "PATCH"
254+
250255 new_version = current_version .bump (
251256 increment ,
252257 prerelease = prerelease ,
You can’t perform that action at this time.
0 commit comments