Skip to content

Fetch JSON Data

Fetch JSON Data #1504

Workflow file for this run

name: Fetch JSON Data
on:
workflow_dispatch:
jobs:
fetch-json:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
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 # Change data.`json to data.json
git commit -m "Update data.json"
git push origin jiang
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}