mirror of
https://github.com/TG-Twilight/AWAvenue-Ads-Rule.git
synced 2025-11-04 14:49:47 +08:00
前缀添加更新日期时间
This commit is contained in:
parent
0e96770338
commit
7c0ac36e25
1
.github/workflows/build.yaml
vendored
1
.github/workflows/build.yaml
vendored
@ -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
|
||||
|
||||
5
main.py
5
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user