From 9d912ba9547e44220aff9dbe0ce0b66827f47526 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 05:50:36 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/ansible.scm.git_publish_module.rst | 48 ++++++++++++++++++++++++ docs/ansible.scm.git_retrieve_module.rst | 16 ++++++++ plugins/action/git_publish.py | 10 ++--- plugins/action/git_retrieve.py | 5 ++- 4 files changed, 72 insertions(+), 7 deletions(-) diff --git a/docs/ansible.scm.git_publish_module.rst b/docs/ansible.scm.git_publish_module.rst index 4aa8bedf..00abc8a7 100644 --- a/docs/ansible.scm.git_publish_module.rst +++ b/docs/ansible.scm.git_publish_module.rst @@ -138,6 +138,54 @@ Parameters
Remove the local copy of the repository if the push is successful
+ + +
+ tag + +
+ dictionary +
+ + + + +
The token used to identify a specific release
+ + + + + +
+ annotation + +
+ string +
+ + + + +
Specify annotate
+ + + + + +
+ message + +
+ string +
+ + + + +
Specify tag message
+ + +
diff --git a/docs/ansible.scm.git_retrieve_module.rst b/docs/ansible.scm.git_retrieve_module.rst index 4d0eebfb..044aa40e 100644 --- a/docs/ansible.scm.git_retrieve_module.rst +++ b/docs/ansible.scm.git_retrieve_module.rst @@ -133,6 +133,22 @@ Parameters + +
+ tag + +
+ string +
+ + + + +
Specify the tag
+ + + +
token diff --git a/plugins/action/git_publish.py b/plugins/action/git_publish.py index 168fee5a..f89f19f1 100644 --- a/plugins/action/git_publish.py +++ b/plugins/action/git_publish.py @@ -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"] @@ -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) @@ -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) diff --git a/plugins/action/git_retrieve.py b/plugins/action/git_retrieve.py index 21318bae..6ba2ba6d 100644 --- a/plugins/action/git_retrieve.py +++ b/plugins/action/git_retrieve.py @@ -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", "--branch", tag, origin], + ["clone", "--depth=1", "--progress", "--branch", tag, origin], ) else: command_parts.extend( - ["clone", "--depth=1", "--progress", "--no-single-branch", origin], + ["clone", "--depth=1", "--progress", "--no-single-branch", origin], ) command = Command(