Skip to content

Commit

Permalink
尝试修复格式化代码机器人
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Apr 16, 2024
1 parent 75426a6 commit cb28a32
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Code format check
# 代码格式化机器人,详细请看 [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 )

on:
push:
branches:
- master
on: [push]

jobs:
dotnet-format:
runs-on: windows-latest
Expand All @@ -25,27 +23,4 @@ jobs:
run: dotnet tool install -g dotnet-format

- name: Run dotnet format
run: dotnet format . -f

- name: Commit files
# 下面将使用机器人的账号,你可以替换为你自己的账号
run: |
git config --local user.name "github-actions-dotnet-formatter[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -a -m 'Automated dotnet-format update'
continue-on-error: true

- name: Create Pull Request
# if: steps.format.outputs.has-changes == 'true' # 如果有格式化,才继续
uses: peter-evans/create-pull-request@v3
with:
title: '[Bot] Automated PR to fix formatting errors'
body: |
Automated PR to fix formatting errors
committer: GitHub <[email protected]>
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# 以下是给定代码审查者,需要设置仓库有权限的开发者
assignees: lindexi,walterlv
reviewers: lindexi,walterlv
# 对应的上传分支
branch: t/bot/fix-codeformatting
run: dotnet format

0 comments on commit cb28a32

Please sign in to comment.