Fix api for url
This commit is contained in:
parent
9b61263254
commit
649ef1fa67
@ -17,7 +17,7 @@ class APISession(Session):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def request(self, method: str | bytes, url: str | bytes, *args, **kwargs) -> Response:
|
def request(self, method: str | bytes, url: str | bytes, *args, **kwargs) -> Response:
|
||||||
url = self.base_url + url
|
url = urljoin(self.base_url + url)
|
||||||
return super().request(method, url, *args, **kwargs)
|
return super().request(method, url, *args, **kwargs)
|
||||||
|
|
||||||
logfile_webhook = None
|
logfile_webhook = None
|
||||||
@ -77,14 +77,14 @@ try:
|
|||||||
repo_id = pipeline_url[1]
|
repo_id = pipeline_url[1]
|
||||||
pipeline_number = pipeline_url[3]
|
pipeline_number = pipeline_url[3]
|
||||||
|
|
||||||
pipeline_info = client.get(f"/repos/{repo_id}/pipelines/{pipeline_number}").json()
|
pipeline_info = client.get(f"/api/repos/{repo_id}/pipelines/{pipeline_number}").json()
|
||||||
for workflow in pipeline_info["workflows"]:
|
for workflow in pipeline_info["workflows"]:
|
||||||
if workflow["name"] != environ["CI_WORKFLOW_NAME"]:
|
if workflow["name"] != environ["CI_WORKFLOW_NAME"]:
|
||||||
continue
|
continue
|
||||||
for step in workflow["children"]:
|
for step in workflow["children"]:
|
||||||
if step["state"] != "failure":
|
if step["state"] != "failure":
|
||||||
continue
|
continue
|
||||||
loginfo = client.get(f"/repos/{repo_id}/logs/{pipeline_number}/{step['id']}").json()
|
loginfo = client.get(f"/api/repos/{repo_id}/logs/{pipeline_number}/{step['id']}").json()
|
||||||
logdata = b""
|
logdata = b""
|
||||||
for logline in loginfo:
|
for logline in loginfo:
|
||||||
logdata += b64decode(logline["data"])
|
logdata += b64decode(logline["data"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user