Skip to content

Get Data

Get Data #619

Workflow file for this run

name: Get Data
on:
workflow_dispatch:
schedule:
- cron: "0 2 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Run Script #Api调用
run: |
php loliconapi.php
- name: Make index
run: |
printf "[" > index.json
ls ./data|while read data
do
printf "\"$data\"," >>index.json
done
sed -i 's/.$//' index.json
echo "]" >>index.json
- name: Commit #上传新的json到仓库
run: |
git config --global user.email AutoupdateRobot@email.com
git config --global user.name AutoupdateRobot
git add .
git commit -m "update json" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}