File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,18 +2,43 @@ name: Update pre-commit hooks
22
33on :
44 schedule :
5- - cron : ' 0 0 * * 0'
6- workflow_dispatch :
5+ - cron : ' 0 0 * * 0' # 每周日 UTC 时间 00:00
6+ workflow_dispatch : # 允许手动触发
77
88jobs :
9- update :
9+ update-pre-commit :
1010 runs-on : ubuntu-latest
11+ permissions :
12+ contents : write
13+ pull-requests : write
14+
1115 steps :
12- - uses : actions/checkout@v4
13- - uses : actions/setup-python@v5
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+ with :
19+ token : ${{ secrets.GITHUB_TOKEN }}
20+
21+ - name : Set up Python
22+ uses : actions/setup-python@v5
23+ with :
24+ python-version : ' 3.11'
25+
26+ - name : Install pre-commit
27+ run : pip install pre-commit
1428
1529 - name : Update pre-commit hooks
16- uses : creyD/pre-commit-update@v1.2.0
30+ run : pre-commit autoupdate
31+
32+ - name : Create Pull Request if changes
33+ uses : peter-evans/create-pull-request@v5
1734 with :
18- token : ${{ secrets.GITHUB_TOKEN }}
19- label : ' dependencies'
35+ commit-message : " chore: update pre-commit hooks"
36+ title : " chore: update pre-commit hooks"
37+ body : |
38+ Automated update of pre-commit hooks via pre-commit autoupdate.
39+
40+ **Changes:**
41+ - Updated hook versions in .pre-commit-config.yaml
42+ branch : " update/pre-commit-hooks"
43+ labels : " dependencies"
44+ delete-branch : true
You can’t perform that action at this time.
0 commit comments