-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.44 KB
/
update-task-progress.yml
File metadata and controls
52 lines (43 loc) · 1.44 KB
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
name: update-task-progress after pull request merged
on:
pull_request_target:
types: [closed]
branches:
- main # 或者你希望触发CI的分支名称
jobs:
build:
if: github.event.pull_request.merged == true # 只有当pull request被合并时才执行CI
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8' # 替换为你需要的Python版本
- name: Install dependencies
run: |
sudo apt install fonts-noto-cjk
python -m pip install --upgrade pip
pip install -r assets/requirements.txt # 如果你的项目有requirements.txt文件
- name: Run Python script
run: |
python assets/update-task-progress.py # 替换为你需要运行的Python脚本
- name: Commit changes and add changes
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git add .
git commit -m "Update task progress" -a
# - name: Push changes
# run: |
# git push
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Push the changes
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
force: true