Skip to content

Commit cf4ccfe

Browse files
committed
update-project-version: Use subprocess.run instead of subprocess.check_output
1 parent 9f8a885 commit cf4ccfe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

update-project-version/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ runs:
5252
id: get-pr-details
5353
run: |
5454
import pathlib, os, subprocess
55-
changed_files = [pathlib.Path(file) for file in subprocess.check_output(["git", "diff", "--name-only"], encoding="ascii").split()]
55+
changed_files = [pathlib.Path(file) for file in subprocess.run(["git", "diff", "--name-only"], capture_output=True, check=True, text=True).stdout.split()]
5656
changed_projects = [file for file in changed_files if file.name == "pyproject.toml"]
5757
project_info = {}
5858
for project in changed_projects:
59-
name, version = subprocess.check_output(["poetry", "version", "-C", str(project.parent)], encoding="ascii").split()
59+
name, version = subprocess.run(["poetry", "version", "-C", str(project.parent)], capture_output=True, check=True, text=True).stdout.split()
6060
project_info[project] = {"name": name, "version": version}
6161
if len(changed_projects) == 1:
6262
title = "chore: Update project {} to v{}".format(project_info[changed_projects[0]]["name"], project_info[changed_projects[0]]["version"])

0 commit comments

Comments
 (0)