Skip to content

Commit b9a88bc

Browse files
committed
fix: update cron schedule for README generation workflow
1 parent e7a6ea8 commit b9a88bc

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Update Schoolwork README
22

33
on:
44
schedule:
5-
- cron: "0 0 * * 1"
5+
- cron: "0 0 1 * *"
66
workflow_dispatch:
77
push:
88
branches:

scripts/generate.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import os
22
import re
33
from collections import defaultdict
4+
from datetime import datetime
5+
from zoneinfo import ZoneInfo
46
from typing import Any
57

68
import requests
@@ -23,6 +25,7 @@
2325

2426
SEMESTER_PATTERN = re.compile(r"^(\d{3})(上|下)\s+")
2527
SCHOOL_NAME_PATTERN = re.compile(r"^(交大|竹科實中)\s+")
28+
TIMEZONE = ZoneInfo("Asia/Taipei")
2629

2730

2831
def fetch_repos() -> list[dict[str, Any]]:
@@ -113,6 +116,8 @@ def build_markdown(repos: list[dict[str, Any]]) -> str:
113116
"",
114117
"This repository indexes my coursework repositories.",
115118
"",
119+
f"_Last updated: {datetime.now(TIMEZONE).date().isoformat()}_",
120+
"",
116121
]
117122

118123
for school in school_order:
@@ -161,4 +166,4 @@ def main() -> None:
161166

162167

163168
if __name__ == "__main__":
164-
main()
169+
main()

0 commit comments

Comments
 (0)