File tree 1 file changed +27
-4
lines changed
1 file changed +27
-4
lines changed Original file line number Diff line number Diff line change 1
1
name : Code format check
2
2
# 代码格式化机器人,详细请看 [dotnet 基于 dotnet format 的 GitHub Action 自动代码格式化机器人](https://blog.lindexi.com/post/dotnet-%E5%9F%BA%E4%BA%8E-dotnet-format-%E7%9A%84-GitHub-Action-%E8%87%AA%E5%8A%A8%E4%BB%A3%E7%A0%81%E6%A0%BC%E5%BC%8F%E5%8C%96%E6%9C%BA%E5%99%A8%E4%BA%BA.html )
3
3
4
- on : [push]
5
-
4
+ on :
5
+ push :
6
+ branches :
7
+ - master
6
8
jobs :
7
9
dotnet-format :
8
10
runs-on : windows-latest
24
26
25
27
- name : Run dotnet format
26
28
run : dotnet format
27
- - name : Output Diff
28
- run : git diff
29
+
30
+ - name : Commit files
31
+ # 下面将使用机器人的账号,你可以替换为你自己的账号
32
+ run : |
33
+ git config --local user.name "github-actions-dotnet-formatter[bot]"
34
+ git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
35
+ git commit -a -m 'Automated dotnet-format update'
36
+ continue-on-error : true
37
+
38
+ - name : Create Pull Request
39
+ # if: steps.format.outputs.has-changes == 'true' # 如果有格式化,才继续
40
+ uses : peter-evans/create-pull-request@v3
41
+ with :
42
+ title : ' [Bot] Automated PR to fix formatting errors'
43
+ body : |
44
+ Automated PR to fix formatting errors
45
+ committer :
GitHub <[email protected] >
46
+ author : github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
47
+ # 以下是给定代码审查者,需要设置仓库有权限的开发者
48
+ assignees : lindexi,walterlv
49
+ reviewers : lindexi,walterlv
50
+ # 对应的上传分支
51
+ branch : t/bot/fix-codeformatting
You can’t perform that action at this time.
0 commit comments