Update cvetrends #83980
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://docs.github.com/cn/actions/automating-builds-and-tests/building-and-testing-python | |
name: Update cvetrends | |
# 定时5分钟 | |
on: | |
schedule: | |
- cron: '*/5 * * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Push articles | |
env: | |
FEISHU_KEY: ${{ secrets.FEISHU_KEY }} | |
run: python3 cvetrends.py -t day | |
- name: Commit | |
run: | | |
git diff | |
git config --global user.email [email protected] | |
git config --global user.name firmianay | |
git add db | |
git commit -m "Update `date +'%T'`" || true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ github.token }} | |
del_runs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete workflow runs | |
uses: Mattraks/delete-workflow-runs@v2 | |
with: | |
token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
retain_days: 3 | |
keep_minimum_runs: 30 |