Fetch JSON Data #237
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
name: Fetch JSON Data | |
on: | |
schedule: | |
- cron: '0 20 * * 0' # 每个周日 UTC 时间 04:00 执行 | |
workflow_dispatch: | |
jobs: | |
fetch-json: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Fetch JSON data | |
run: | | |
curl https://api.dabing.one?whiteboard_id=d4cc3728297609add1a00aab108e90c4e57a1c378cfc2307c251745bf7d2a884 > data.json | |
- name: Save JSON data to repository | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "GitHub Actions" | |
git pull | |
git add data.json | |
git commit -m "Update data.json" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} |