Skip to content

Commit ae001e6

Browse files
Update format workflow to auto-commit fixes on PRs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2ceb207 commit ae001e6

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

.github/workflows/format.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
name: Format
22

33
on:
4-
push:
5-
branches: ["master"]
64
pull_request:
75
branches: ["master"]
86

7+
permissions:
8+
contents: write
9+
910
jobs:
1011
format:
1112
runs-on: windows-latest
1213

1314
steps:
14-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.head_ref }}
18+
token: ${{ secrets.GITHUB_TOKEN }}
1519

1620
- name: Setup .NET
1721
uses: actions/setup-dotnet@v4
1822
with:
19-
dotnet-version: 8.0.x
23+
dotnet-version: 9
2024

21-
- name: Install dotnet-format tool
22-
run: dotnet tool install -g dotnet-format --version "8.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json
25+
- name: Run dotnet format
26+
run: dotnet format whitespace
2327

24-
- name: Run dotnet-format
25-
run: dotnet-format whitespace --verify-no-changes
28+
- name: Commit changes
29+
if: github.event_name != 'pull_request' || github.repository == github.event.pull_request.head.repo.full_name
30+
uses: stefanzweifel/git-auto-commit-action@v5
31+
with:
32+
commit_message: "style: auto-format whitespace"

0 commit comments

Comments
 (0)