Delete .github directory

This commit is contained in:
wd210010 authored and GitHub committed 2025-02-19 10:31:56 +08:00
1 parent 85a0aa4556
commit d191770960
4 files changed
-70

No files matched your search

-1
View File
@@ -1 +0,0 @@
-40
View File
@@ -1,40 +0,0 @@
name: Update Date
on:
schedule:
- cron: '0 0,8,12,16 * * *'
push:
branches:
- main
jobs:
update-date:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run the update script
run: |
python update_date.py
- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add date_config.json
git commit -m "Update date to $(date +'%Y-%m-%d')"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-3
View File
@@ -1,3 +0,0 @@
requests
json
datetime
-26
View File
@@ -1,26 +0,0 @@
import json
from datetime import datetime
# 获取当前日期
current_date = datetime.now().strftime('%Y-%m-%d')
# 定义 JSON 文件路径
json_file = 'date_config.json'
# 更新 JSON 文件
def update_json():
try:
with open(json_file, 'r') as f:
data = json.load(f)
except FileNotFoundError:
data = {}
# 更新日期字段
data['date'] = current_date
# 写回更新后的内容
with open(json_file, 'w') as f:
json.dump(data, f, indent=4)
if __name__ == '__main__':
update_json()