🎨 Format Python code with Black
This commit is contained in:
parent
f6cb50d374
commit
d1bfe996ad
1 changed files with 9 additions and 4 deletions
|
@ -67,8 +67,10 @@ async def github_post(request: Request) -> HTTPResponse:
|
||||||
if event == "issue_comment":
|
if event == "issue_comment":
|
||||||
infos = request.json
|
infos = request.json
|
||||||
valid_pr_comment = (
|
valid_pr_comment = (
|
||||||
infos["action"] == "created" and infos["issue"]["state"] == "open"
|
infos["action"] == "created"
|
||||||
and "pull_request" in infos["issue"] )
|
and infos["issue"]["state"] == "open"
|
||||||
|
and "pull_request" in infos["issue"]
|
||||||
|
)
|
||||||
pr_infos = await get_pr_infos(request)
|
pr_infos = await get_pr_infos(request)
|
||||||
|
|
||||||
if valid_pr_comment:
|
if valid_pr_comment:
|
||||||
|
@ -169,7 +171,7 @@ def bump_revision(request: Request, pr_infos: dict) -> HTTPResponse:
|
||||||
)
|
)
|
||||||
repo.git.checkout(branch)
|
repo.git.checkout(branch)
|
||||||
|
|
||||||
manifest_file = (folder / "manifest.toml")
|
manifest_file = folder / "manifest.toml"
|
||||||
manifest = tomlkit.load(manifest_file.open("r", encoding="utf-8"))
|
manifest = tomlkit.load(manifest_file.open("r", encoding="utf-8"))
|
||||||
version, revision = manifest["version"].split("~ynh")
|
version, revision = manifest["version"].split("~ynh")
|
||||||
revision = str(int(revision) + 1)
|
revision = str(int(revision) + 1)
|
||||||
|
@ -177,7 +179,10 @@ def bump_revision(request: Request, pr_infos: dict) -> HTTPResponse:
|
||||||
tomlkit.dump(manifest, manifest_file.open("w", encoding="utf-8"))
|
tomlkit.dump(manifest, manifest_file.open("w", encoding="utf-8"))
|
||||||
|
|
||||||
repo.git.add("manifest.toml")
|
repo.git.add("manifest.toml")
|
||||||
repo.index.commit("Bump package revision", author=Actor("yunohost-bot", "yunohost@yunohost.org"))
|
repo.index.commit(
|
||||||
|
"Bump package revision",
|
||||||
|
author=Actor("yunohost-bot", "yunohost@yunohost.org"),
|
||||||
|
)
|
||||||
|
|
||||||
logging.debug(f"Pushing {repository}")
|
logging.debug(f"Pushing {repository}")
|
||||||
repo.remote().push(quiet=False, all=True)
|
repo.remote().push(quiet=False, all=True)
|
||||||
|
|
Loading…
Reference in a new issue