diff --git a/.github/workflows/date.json b/.github/workflows/date.json deleted file mode 100644 index 8b13789..0000000 --- a/.github/workflows/date.json +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml deleted file mode 100644 index 3e825c3..0000000 --- a/.github/workflows/python-app.yml +++ /dev/null @@ -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 }} diff --git a/.github/workflows/requirements.txt b/.github/workflows/requirements.txt deleted file mode 100644 index 4f73715..0000000 --- a/.github/workflows/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -requests -json -datetime diff --git a/.github/workflows/update_date.py b/.github/workflows/update_date.py deleted file mode 100644 index 803b9f6..0000000 --- a/.github/workflows/update_date.py +++ /dev/null @@ -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()