前缀添加更新日期时间

This commit is contained in:
Elysia 2025-03-08 19:29:06 +08:00
parent 0e96770338
commit 7c0ac36e25
No known key found for this signature in database
GPG Key ID: 0B5B67E3895175F9
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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