forked from cqpcy/cloud189-action-1
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.2 KB
/
run.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
name: 签到
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 22,14 * * *'
watch:
types: started
jobs:
build:
runs-on: ubuntu-latest
if: github.event.repository.owner.id == github.event.sender.id
steps:
- uses: actions/checkout@v2
- name: 初始化Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: 签到
run: |
pip install -r requirements.txt
user='${{ secrets.USER }}'
pwd='${{ secrets.PWD }}'
user_list=()
pwd_list=()
IFS="#"
for u in ${user[*]}
do
user_list[${#user_list[*]}]=${u}
done
for p in ${pwd[*]}
do
pwd_list[${#pwd_list[*]}]=${p}
done
user_num=${#user_list[*]}
pwd_num=${#pwd_list[*]}
if [ $user_num != $pwd_num ];then
echo "账号和密码个数不对应"
exit 1
else
echo "共有 $user_num 个账号,即将开始签到"
fi
for ((i=0;i<$user_num;i++))
do
python3 checkin.py <<EOF
${user_list[$i]}
${pwd_list[$i]}
EOF
done