Skip to content

Commit

Permalink
Audit: more debug messages on diff
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jun 17, 2024
1 parent 82cf5f8 commit 246a893
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions github_app_geo_project/module/audit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ async def _process_snyk_dpkg(
["git", "diff", "--quiet"], timeout=30
)
if diff_proc.returncode != 0:
proc = subprocess.run( # nosec # pylint: disable=subprocess-run-check
["git", "diff"], timeout=30, capture_output=True, encoding="utf-8"
)
message = module_utils.ansi_proc_message(proc)
message.title = "Changes to be committed"
_LOGGER.debug(message)

proc = subprocess.run( # nosec # pylint: disable=subprocess-run-check
["git", "checkout", "-b", new_branch], capture_output=True, encoding="utf-8", timeout=30
)
Expand All @@ -254,6 +261,8 @@ async def _process_snyk_dpkg(
else:
if pull_request is not None:
issue_check.set_title(key, f"{key} ([Pull request]({pull_request.html_url}))")
else:
_LOGGER.debug("No changes to commit")
except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as proc_error:
message = module_utils.ansi_proc_message(proc_error)
_LOGGER.exception("Audit %s process error", key)
Expand Down

0 comments on commit 246a893

Please sign in to comment.