Skip to content

Commit

Permalink
fix: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dfederschmidt committed Oct 1, 2024
1 parent 0cd9671 commit 7ca4d7d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 43 deletions.
43 changes: 0 additions & 43 deletions .github/tests/find_changed_playbooks.py

This file was deleted.

26 changes: 26 additions & 0 deletions .github/tests/run_on_changed_playbooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
import argparse
import robot
import os
import subprocess
from find_changed_playbooks import get_changed_files_without_extension

def get_changed_files_without_extension(base_branch):
# Run the git diff command to get the changed files compared to the base branch
result = subprocess.run(
['git', 'diff', '--name-only', base_branch],
stdout=subprocess.PIPE,
text=True
)

files = result.stdout.splitlines()

# Only consider files in the root directory and with .json or .py extensions
root_files = [
file for file in files
if '/' not in file and (file.endswith('.json') or file.endswith('.py')) # No subdirectories allowed
]

# Remove extensions and only return the files that still exist in the working directory
files_without_extension = [
os.path.splitext(file)[0] for file in root_files if os.path.exists(file)
]

# Return unique file names without extensions
return list(set(files_without_extension))

def run_robot_tests(robot_file: str, playbook: str):

result = robot.run(
Expand Down

0 comments on commit 7ca4d7d

Please sign in to comment.