Get Data #626
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: 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 }} |