From 03a8b2444938a95ddd4f543ec6f35443053e6622 Mon Sep 17 00:00:00 2001 From: Radek Golan Date: Wed, 24 Apr 2024 12:56:17 +0200 Subject: [PATCH] fix(api): fix apiurls --- src/discord_notifier/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/discord_notifier/__main__.py b/src/discord_notifier/__main__.py index 8fc9578..ea97d19 100644 --- a/src/discord_notifier/__main__.py +++ b/src/discord_notifier/__main__.py @@ -69,14 +69,14 @@ try: with APISession(urljoin(environ["PLUGIN_WOODPECKER_URL"], "/api")) as client: client.headers.setdefault("Authorization", f"Bearer {environ["PLUGIN_WOODPECKER_TOKEN"]}") pipeline_url = urlparse(environ["CI_PIPELINE_URL"]).path - pipeline_info = client.get(pipeline_url).json() + pipeline_info = client.get("./" + pipeline_url.lstrip("/")).json() for workflow in pipeline_info["workflows"]: if workflow["name"] != environ["CI_WORKFLOW_NAME"]: continue for step in workflow["children"]: if step["state"] != "failure": continue - logdata = client.get(urljoin(pipeline_url, step["id"])) + logdata = client.get("./" + urljoin(pipeline_url, step["id"]).lstrip("/")) webhook.add_file(logdata.content, f"{step['name']}.log") except KeyError: webhook.add_embed(DiscordEmbed(