-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.11 KB
/
weread.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
name: generate weread card
on:
workflow_dispatch:
schedule:
- cron: "0 0/8 * * *"
jobs:
card:
name: Card
runs-on: ubuntu-latest
env:
WEREAD_COOKIE: ${{ secrets.WEREAD_COOKIE }}
BOOK_COUNT: ${{ secrets.BOOK_COUNT }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set default BOOK_COUNT if not set
run: |
if [ -z "$BOOK_COUNT" ]; then
echo "BOOK_COUNT=4" >> $GITHUB_ENV
fi
- name: generate weread card
run: |
python main.py -n $BOOK_COUNT -c "$WEREAD_COOKIE"
- name: push
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m 'generate weread card' || echo "nothing to commit"
git push || echo "nothing to push"