Skip to content

Commit

Permalink
new commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaRaimec22 committed Mar 10, 2024
1 parent b8dd201 commit 557ea69
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/check_files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys
import argparse
import subprocess
import shlex
import glob


Expand All @@ -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,
Expand All @@ -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


Expand Down Expand Up @@ -157,4 +156,4 @@ def main():


if __name__ == "__main__":
main()
main()

0 comments on commit 557ea69

Please sign in to comment.