Commit 953ffae 1 parent 732ce54 commit 953ffae Copy full SHA for 953ffae
File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Update License Year
2
+
3
+ on :
4
+ schedule :
5
+ - cron : ' 0 0 1 1 *' # 每年1月1日运行
6
+ workflow_dispatch : # 允许手动触发
7
+
8
+ jobs :
9
+ update-license-year :
10
+ runs-on : ubuntu-latest
11
+ permissions :
12
+ contents : write
13
+ steps :
14
+ - uses : actions/checkout@v2
15
+ with :
16
+ fetch-depth : 0
17
+
18
+ - name : Update year in LICENSE
19
+ run : |
20
+ # 获取当前年份
21
+ CURRENT_YEAR=$(date +%Y)
22
+ # 更新 LICENSE 文件中的年份
23
+ sed -i "s/Copyright (c) [0-9]\{4\}/Copyright (c) ${CURRENT_YEAR}/" LICENSE
24
+
25
+ - name : Create Pull Request
26
+ uses : peter-evans/create-pull-request@v5
27
+ with :
28
+ commit-message : " chore: update license year to ${{ env.CURRENT_YEAR }}"
29
+ title : " chore: update license year"
30
+ body : |
31
+ Automated changes:
32
+ - Updated copyright year in LICENSE file to current year
33
+ branch : update-license-year
34
+ base : main
35
+ delete-branch : true
You can’t perform that action at this time.
0 commit comments