From 557ea6929f4b1c2ba98a9a05f3ad23eb0a4942dc Mon Sep 17 00:00:00 2001 From: aditya Date: Sun, 10 Mar 2024 19:58:23 +0530 Subject: [PATCH] new commit --- .github/workflows/check_files.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check_files.py b/.github/workflows/check_files.py index 431ef56a27..cf1afdcd2f 100644 --- a/.github/workflows/check_files.py +++ b/.github/workflows/check_files.py @@ -1,6 +1,7 @@ import sys import argparse import subprocess +import shlex import glob @@ -18,14 +19,12 @@ def _get_changed_files(base_branch, pr_branch): base_branch = f"origin/{base_branch}" pr_branch = f"origin/{pr_branch}" - command = f"git diff --name-only {base_branch}..{pr_branch} --diff-filter=ACMRT | xargs " - + command = f"git diff --name-only {base_branch}..{pr_branch} --diff-filter=ACMRT" try: # Run git command to get the list of changed files process = subprocess.Popen( - command, - shell=True, + shlex.split(command), stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, @@ -37,7 +36,7 @@ def _get_changed_files(base_branch, pr_branch): print(f"Error: {e}") sys.exit(1) - changed_files = [file.strip() for file in output.split(" ") if file.strip()] + changed_files = [file.strip() for file in output.splitlines() if file.strip()] return changed_files @@ -157,4 +156,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main()