diff --git a/plugins/action/git_publish.py b/plugins/action/git_publish.py index b98e5212..66195dbb 100644 --- a/plugins/action/git_publish.py +++ b/plugins/action/git_publish.py @@ -220,10 +220,9 @@ def _push(self: T) -> None: no_log[token_base64] = "" tag = self._task.args.get("tag") + command_parts.extend(["push", "origin", "HEAD"]) if tag: - command_parts.extend(["push", "--tags", "origin", "HEAD"]) - else: - command_parts.extend(["push", "origin", "HEAD"]) + command_parts.extend(["--tags"]) command = Command( command_parts=command_parts, fail_msg="Failed to perform the push", diff --git a/plugins/action/git_retrieve.py b/plugins/action/git_retrieve.py index 7d83051e..999ec85f 100644 --- a/plugins/action/git_retrieve.py +++ b/plugins/action/git_retrieve.py @@ -179,15 +179,17 @@ def _clone(self: T) -> None: no_log[token_base64] = "" tag = self._task.args["origin"].get("tag") + command_parts.extend( + ["clone", "--depth=1", "--progress"], + ) if tag: command_parts.extend( - ["clone", "--depth=1", "--progress", "--branch", tag, origin], + ["--branch", tag], ) else: command_parts.extend( - ["clone", "--depth=1", "--progress", "--no-single-branch", origin], + ["--no-single-branch", origin], ) - command = Command( command_parts=command_parts, env=env, @@ -270,7 +272,7 @@ def _switch_checkout(self: T) -> None: else: tag = self._task.args["origin"].get("tag") if tag: - command_parts.extend(["checkout", "-b", branch]) + command_parts.extend(["checkout", "-b", tag]) else: command_parts.extend(["checkout", "-t", "-b", branch]) diff --git a/plugins/modules/git_publish.py b/plugins/modules/git_publish.py index 28d7027d..f57d3520 100644 --- a/plugins/modules/git_publish.py +++ b/plugins/modules/git_publish.py @@ -63,7 +63,7 @@ type: str tag: description: - - The token used to identify a specific release + - Specify the tag details associated with the commit. type: dict suboptions: annotation: