Skip to content

Fetch JSON Data

Fetch JSON Data #1414

Workflow file for this run

name: Fetch JSON Data
on:
schedule:
- cron: '*/5 * * * *' # 每天 UTC 时间 04:00 执行
workflow_dispatch:
jobs:
fetch-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref:'jiang'

Check failure on line 15 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / Fetch JSON Data

Invalid workflow file

The workflow is not valid. .github/workflows/main.yml (Line: 15, Col: 11): Unexpected value 'ref:'jiang''
- name: Fetch JSON data
run: |
curl https://api.dabing.one > src/resources/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 checkout -b jiang
git pull
git add src/resources/data.json
git commit -m "Update data.json"
git push origin jiang
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}