Skip to content

Commit

Permalink
locks
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-mailslurp committed May 3, 2024
1 parent 60c50c7 commit e174626
Show file tree
Hide file tree
Showing 4 changed files with 560 additions and 127 deletions.
48 changes: 48 additions & 0 deletions .build/check-deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import os
import subprocess
import re

# Initialize an empty list to store folders with outdated dependencies
error_array = []

# Read .githubactionsignore file
with open('.githubactionsignore', 'r') as f:
ignore_list = f.read().splitlines()

# Iterate over the items in the root directory
for item in os.listdir('.'):
# Ignore files and directories in .githubactionsignore
if item in ignore_list:
continue

# Ignore non-directory items
if not os.path.isdir(item):
continue

# Split the folder name on _ or -
parts = re.split('_|-', item)

# Check if the first part starts with 'js' or 'javascript'
if parts[0].lower().startswith(('js', 'javascript')):
# Change into the directory
os.chdir(item)

# Run 'npm outdated' and capture the output
result = subprocess.run(['npm', 'outdated'], capture_output=True, text=True)

# If there are outdated dependencies, add the folder to the error array
if result.stdout:
error_array.append(item)

# Change back to the root directory
os.chdir('..')

# If the error array is not empty, print the folders and exit with code 1
if error_array:
print("The following folders have outdated dependencies:")
for folder in error_array:
print(folder)
exit(1)
else:
print("All good")
exit(0)
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ copy-screenshots:

# checks
check-actions:
python3 .build/check-actions.py
python3 .build/check-actions.py
check-deps:
python3 .build/check-deps.py
Loading

0 comments on commit e174626

Please sign in to comment.