Skip to content

Daily Script

Daily Script #447

Workflow file for this run

# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Daily Script
on:
# push:
# branches: [ main ]
schedule:
- cron: '05 16 * * *' # UTC 时间 16:05 北京时间大约 00:05
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup timezone # https://github.com/marketplace/actions/setup-timezone
uses: zcong1993/setup-timezone@master
with:
timezone: Asia/Shanghai
- name: Check out repo
uses: actions/checkout@v2
- name: Set up Python 3.11 # https://github.com/actions/setup-python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'
cache-dependency-path: '**/requirements.txt'
- name: Install requirements dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Update zhihu
run: |
python zhihu.py
# - name: Update bilibili
# run: |
# python bilibili.py ${{ secrets.BILIBILI_SESSDATA }}
- name: Commit
run: |
git diff
git config --global user.email [email protected]
git config --global user.name lmmsoft
git add .
#git commit -m"action:`date +'%Y-%m-%d'`"
git commit -m "Action: `date +'%Y-%m-%d %H:%M %z %Z'`"
git pull --rebase
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.ACTION_TOKEN }}
- name: Send Feishu text message # https://github.com/marketplace/actions/feishu-bot-action
uses: foxundermoon/feishu-action@v2 # 上下文 https://docs.github.com/en/actions/learn-github-actions/contexts
with:
url: ${{ secrets.FEISHU_BOT_WEBHOOK_URL }}
msg_type: text
content: |
text: |
workflow: ${{ github.workflow }}
repository: ${{ github.repository }}
committer: ${{ github.actor }}
compare: ${{ github.event.compare }}
job status: ${{ job.status }}