-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.17 KB
/
update_srs.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
name: Automatic updating of srs files
on:
schedule:
- cron: '0 18 */3 * *' # 每3天的 UTC+8 2:00 (即 UTC 18:00)
workflow_dispatch: # 允许手动触发
push:
paths:
- 'tools/**' # 仅在 tools 目录有变化时触发
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Change directory to tools and run scripts
run: |
cd tools
python list_json.py
bash convert2srs.sh
- name: Commit changes
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
if [ -n "$(git status --porcelain)" ]; then
git add tools/temp_rules/
git add tools/srs/
git commit -m 'Add downloaded files to temp_rules and srs'
git push
else
echo "No changes to commit"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}