Skip to content

Commit

Permalink
Audit: Fix undefined output_url
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Aug 9, 2024
1 parent 277935b commit f360178
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions github_app_geo_project/module/audit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ async def _process_snyk_dpkg(
logs_url,
env,
)
body_md = body.to_markdown() if body is not None else ""
del body
success &= new_success
output_url = _process_error(
context,
Expand All @@ -190,20 +192,20 @@ async def _process_snyk_dpkg(
_LOGGER.debug(message)
if output_url is not None:
short_message.append(f"[Output]({output_url})")
if body_md:
body_md += f"\n"
body_md += f"[Output]({output_url})" if output_url is not None else ""

if context.module_event_data.type == "dpkg":
body = module_utils.HtmlMessage("Update dpkg packages\n")
body_md = "Update dpkg packages"

if os.path.exists("ci/dpkg-versions.yaml"):
await audit_utils.dpkg(
context.module_config.get("dpkg", {}), local_config.get("dpkg", {})
)

body_md = body.to_markdown() if body is not None else ""
del body
body_md += "\n" if body_md else ""
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

0 comments on commit f360178

Please sign in to comment.