Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 30, 2023
1 parent 59d06a8 commit 4696718
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 7 deletions.
48 changes: 48 additions & 0 deletions docs/ansible.scm.git_publish_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,54 @@ Parameters
<div>Remove the local copy of the repository if the push is successful</div>
</td>
</tr>
<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>tag</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">dictionary</span>
</div>
</td>
<td>
</td>
<td>
<div>The token used to identify a specific release</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>annotation</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>Specify annotate</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>message</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>Specify tag message</div>
</td>
</tr>

<tr>
<td colspan="2">
<div class="ansibleOptionAnchor" id="parameter-"></div>
Expand Down
16 changes: 16 additions & 0 deletions docs/ansible.scm.git_retrieve_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,22 @@ Parameters
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>tag</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>Specify the tag</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>token</b>
Expand Down
10 changes: 5 additions & 5 deletions plugins/action/git_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _commit(self: T) -> None:
self._run_command(command=command)

def _tag(self):
"""Create a tag object"""
"""Create a tag object."""
command_parts = list(self._base_command)
message = self._task.args["tag"]["message"]
annotate = self._task.args["tag"]["annotation"]
Expand All @@ -189,7 +189,6 @@ def _tag(self):
)
self._run_command(command=command)


def _push(self: T) -> None:
"""Push the commit to the origin."""
command_parts = list(self._base_command)
Expand Down Expand Up @@ -278,15 +277,16 @@ def run(
if self._task.args.get("tag"):
steps += (self._tag,)

steps += (self._push,
self._remove_repo,)
steps += (
self._push,
self._remove_repo,
)

for step in steps:
step()
if self._result.failed:
return asdict(self._result)


if self._result.pr_url and self._task.args["open_browser"]:
webbrowser.open(self._result.pr_url, new=2)

Expand Down
5 changes: 3 additions & 2 deletions plugins/action/git_retrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,14 @@ def _clone(self: T) -> None:
tag = self._task.args["origin"].get("tag")
if tag:
import q

q(tag)
command_parts.extend(
["clone", "--depth=1", "--progress", "--no-single-branch", origin, tag],
["clone", "--depth=1", "--progress", "--no-single-branch", origin, tag],
)
else:
command_parts.extend(
["clone", "--depth=1", "--progress", "--no-single-branch", origin],
["clone", "--depth=1", "--progress", "--no-single-branch", origin],
)

command = Command(
Expand Down

0 comments on commit 4696718

Please sign in to comment.