Skip to content

Commit

Permalink
Add a message tin the Snyk fix pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Dec 6, 2022
1 parent 14ab6a8 commit e131e18
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions c2cciutils/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ def snyk(
print(f"::group::Run: {' '.join(command)}")
sys.stdout.flush()
sys.stderr.flush()
subprocess.run(command, env=env) # pylint: disable=subprocess-run-check
snyk_fix_proc = subprocess.run( # pylint: disable=subprocess-run-check
command, env=env, stdout=subprocess.PIPE, encoding="utf-8"
)
snyk_fix_message = snyk_fix_proc.stdout.strip()
print("::endgroup::")

if not args.fix:
Expand Down Expand Up @@ -199,7 +202,14 @@ def snyk(
c2cciutils.configuration.AUDIT_SNYK_FIX_PULL_REQUEST_ARGUMENTS_DEFAULT,
)
subprocess.run(
["gh", "pr", "create", f"--base={current_branch}", *fix_github_create_pull_request_arguments],
[
"gh",
"pr",
"create",
f"--base={current_branch}",
f"--body={snyk_fix_message}",
*fix_github_create_pull_request_arguments,
],
check=True,
env=env,
)
Expand Down

0 comments on commit e131e18

Please sign in to comment.