Skip to content

Commit ec64e11

Browse files
authored
Update substack_blogs.yml
1 parent e737547 commit ec64e11

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/substack_blogs.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,18 @@ jobs:
275275
end_marker: The marker indicating the end of the section to update.
276276
"""
277277
try:
278+
# Validate inputs
279+
if not filename or not isinstance(filename, str):
280+
print(f"Invalid filename: '{filename}'")
281+
return False
282+
283+
print(f"Attempting to update file: '{filename}'")
284+
278285
# Make sure the directory exists
279286
import os
280-
os.makedirs(os.path.dirname(filename), exist_ok=True)
287+
dir_name = os.path.dirname(filename)
288+
if dir_name: # Only try to create directory if there is one
289+
os.makedirs(dir_name, exist_ok=True)
281290
282291
# Check if file exists, if not create it with initial content
283292
if not os.path.exists(filename):

0 commit comments

Comments
 (0)