Skip to content

Commit

Permalink
Comments Incorporated
Browse files Browse the repository at this point in the history
Signed-off-by: rohitthakur2590 <[email protected]>
  • Loading branch information
rohitthakur2590 committed Aug 21, 2023
1 parent 29b6da4 commit 9f3d495
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions plugins/action/git_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,9 @@ def _push(self: T) -> None:
no_log[token_base64] = "<TOKEN>"

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",
Expand Down
10 changes: 6 additions & 4 deletions plugins/action/git_retrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,17 @@ def _clone(self: T) -> None:
no_log[token_base64] = "<TOKEN>"

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,
Expand Down Expand Up @@ -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])

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/git_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9f3d495

Please sign in to comment.