-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (33 loc) · 871 Bytes
/
php.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 }}