File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 17
17
steps :
18
18
- name : Checkout
19
19
uses : actions/checkout@v4
20
+
21
+ - name : Update last modified dates
22
+ run : |
23
+ # 現在の日付を取得 (JST)
24
+ current_date=$(TZ=Asia/Tokyo date '+%Y/%m/%d')
25
+
26
+ # .md ファイルの最終更新日コメントを更新
27
+ find . -name "*.md" -type f -exec grep -l "最終更新日" {} \; | while read file; do
28
+ echo "Updating date in: $file"
29
+ sed -i "s|<!--最終更新日: [0-9/]*[[:space:]]*-->|<!--最終更新日: $current_date -->|g" "$file"
30
+ done
31
+
32
+ # 変更があった場合のみコミット
33
+ if ! git diff --quiet; then
34
+ git config --local user.email "[email protected] "
35
+ git config --local user.name "GitHub Action"
36
+ git add .
37
+ git commit -m "自動更新: 最終更新日を $current_date に更新"
38
+ git push
39
+ else
40
+ echo "No changes to commit"
41
+ fi
20
42
21
43
- name : Setup Node
22
44
uses : actions/setup-node@v4
You can’t perform that action at this time.
0 commit comments