Skip to content

Commit

Permalink
Audit: Add links to logs in Snyk pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Aug 9, 2024
1 parent 343bef2 commit 157b841
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions github_app_geo_project/module/audit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,8 @@ async def _process_snyk_dpkg(
)
message.title = "Output URL"
_LOGGER.debug(message)
if body is not None:
body.html += "\n"
if output_url is not None:
short_message.append(f"[Output]({output_url})")
if body is not None:
body.html += f"\n<a href='{output_url}'>Output</a>"

if context.module_event_data.type == "dpkg":
body = module_utils.HtmlMessage("Update dpkg packages\n")
Expand All @@ -203,8 +199,12 @@ async def _process_snyk_dpkg(
context.module_config.get("dpkg", {}), local_config.get("dpkg", {})
)

if body is not None:
body.html += f"\n<a href='{logs_url}'>Logs</a>"
body_md = body.to_markdown() if body is not None else ""
del body
if body_md:
body_md.html += "\n"
body_md += f"[Logs]({logs_url})"
body_md += f"\n[Output]({output_url})" if output_url is not None else ""
short_message.append(f"[Logs]({logs_url})")

diff_proc = subprocess.run( # nosec # pylint: disable=subprocess-run-check
Expand Down Expand Up @@ -234,7 +234,7 @@ async def _process_snyk_dpkg(
branch,
new_branch,
f"Audit {key}",
"" if body is None else body.to_markdown(),
body_md,
context.github_project,
)
success &= new_success
Expand Down

0 comments on commit 157b841

Please sign in to comment.