-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (59 loc) · 1.61 KB
/
AutoApihu.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#自动调用api保活,模仿人为开发版
name: Auto Api Human
on:
release:
types: [published]
# push:
# tags:
# - 'v*'
# branches:
# - main
schedule:
- cron: "0 9,13,16 * * 1-5"
watch:
types: [started]
# repository_dispatch:
# types: [webapi]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Python #安装python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install requests #安装requests
run: |
pip install requests pytz
- name: Read config from secrets #读取机密
env:
CONFIG_ID: ${{ secrets.CONFIG_ID }} # secrets_id 提供
CONFIG_KEY: ${{ secrets.CONFIG_KEY }} # secrets_key 提供
ID: ${{ secrets.ID }}
KEY: ${{ secrets.KEY }}
run: |
cp 1.py 2.py
echo $CONFIG_ID > configid.txt
echo $CONFIG_KEY > configkey.txt
sed -i '10 r configid.txt' 2.py
sed -i '12 r configkey.txt' 2.py
- name: Test Api #Api调用
run: |
python 2.py
- name: Delete secrets config #删除机密
run: |
rm -f 2.py
rm -f configid.txt
rm -f configkey.txt
- name: Commit #上传新的time.log到仓库
run: |
git config --global user.email [email protected]
git config --global user.name donxan
git add time.log
git commit -m "update time log" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}