Skip to content

Commit

Permalink
Debug stage checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilshan-H committed Nov 15, 2023
1 parent e16dce7 commit e4efc94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/convert_ics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ jobs:
git config --global user.name "GitHub Actions"
csv_branch_name="csv-files-$year"
git checkout -b "$csv_branch_name"
tree
python converters/icalendar_to_csv.py "$file"
echo
tree
git status
git add "csv/$year.csv"
git commit -m "Convert $year.ics to $year.csv [skip ci]"
Expand Down
2 changes: 2 additions & 0 deletions converters/icalendar_to_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ def ics_to_csv(file_path):

csv_dir = os.path.abspath(os.path.join(os.curdir, os.pardir, CSV_DIR_NAME))
os.makedirs(csv_dir, exist_ok=True)
print(f"Created directory: {csv_dir}")

# Get the filename (without extension) from the input path
file_name = os.path.splitext(os.path.basename(file_path))[0]

# Create the CSV file path
csv_file_path = os.path.join(csv_dir, f"{file_name}.csv")
print(f"CSV file path: {csv_file_path}")

with open(csv_file_path, "w", newline="", encoding="utf-8") as file:
fieldnames = [
Expand Down
2 changes: 1 addition & 1 deletion ics/2021.ics
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ STATUS:CONFIRMED
UID:sl_26
DTSTART;VALUE=DATE:20211230
DTEND;VALUE=DATE:20211231
SUMMARY:Temp Holiday v6
SUMMARY:Temp Holiday v7
DESCRIPTION:Public,Bank,Mercantile
END:VEVENT
END:VCALENDAR

0 comments on commit e4efc94

Please sign in to comment.