mirror of
https://github.com/wd210010/only_for_happly.git
synced 2026-11-06 04:36:44 +08:00
41 lines
917 B
YAML
41 lines
917 B
YAML
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 }}
|