diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 18d0578..d853cba 100755 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -20,6 +20,7 @@ jobs: - name: Execute Python script run: | + TZ=Asia/Shanghai date #设置时区 git clone "https://${{ github.actor }}:${{ secrets.TOKEN }}@github.com/${{ github.repository }}" -b build build cd build mkdir out diff --git a/main.py b/main.py index 75b2ecb..8028a7e 100755 --- a/main.py +++ b/main.py @@ -1,6 +1,7 @@ import os import importlib import subprocess +from datetime import datetime SCRIPT_PATH = os.path.join(os.getcwd(), "script") # 插件文件夹 RULE_PATH = os.path.join(os.getcwd(), "rule") # 规则文件夹 @@ -24,11 +25,13 @@ def WriteFile(name, text, suffix, comment, module_total): # 写入文件 with open(OUT_PATH + "/AWAvenue-Ads-Rule-" + name + suffix, 'w', encoding="utf-8") as file: if comment != "": + now = datetime.now() title = f"""{comment}Title: AWAvenue Ads Rule {comment}-------------------------------------- {comment}Total lines: {module_total} {comment}Version: {get_latest_git_tag()} -{comment}Updated content: {subprocess.check_output(['git', 'log', '-1', '--pretty=%B']).strip().decode('utf-8')} +{comment}Update time: {now.strftime("%Y-%m-%d %H:%M:%S")} UTC+8 +{comment}Update content: {subprocess.check_output(['git', 'log', '-1', '--pretty=%B']).strip().decode('utf-8')} {comment}Homepage: https://github.com/TG-Twilight/AWAvenue-Ads-Rule {comment}License: https://github.com/TG-Twilight/AWAvenue-Ads-Rule/blob/main/LICENSE