-
-
Notifications
You must be signed in to change notification settings - Fork 11
66 lines (51 loc) · 1.27 KB
/
main.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
64
65
66
name: Update
on:
push:
paths:
- 'HK.csv'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install pypinyin
- name: Run main.py script
run: |
ls
python main.py
ls
- name: Update README.md with current date
run: |
date_str=$(date +'%Y/%m/%d')
sed -i "s#^数据更新时间:.*#数据更新时间: ${date_str}#" README.md
- name: Configure Git
run: |
git config --global user.name "update"
git config --global user.email "tg@spiritlhl.top"
- name: Add files to Git staging area
run: |
ls
pwd
git add .
- name: Check Git status
run: |
git branch -a
git remote -v
git status
- name: Commit changes
run: |
(
git commit -m "Update CSV files"
) || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}