-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (41 loc) · 1.04 KB
/
format-cs-files.yml
File metadata and controls
49 lines (41 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Format *.cs files
on:
pull_request:
branches:
- 'main'
- 'preview/**'
- 'release/**'
- 'support/**'
paths:
- '**.cs'
permissions:
actions: read
contents: write
concurrency:
group: format-${{ github.head_ref || github.ref }}
cancel-in-progress: false
env:
dotnet-sdk-version: '9.x'
jobs:
formatting:
name: Format whitespace, code style and file header
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ github.head_ref || github.ref }}
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet-sdk-version }}
- name: Format with .NET CLI
run: |
dotnet format whitespace
dotnet format style
dotnet format analyzers --diagnostics IDE0005 IDE0073
working-directory: ${{ github.workspace }}
- name: 'Push changes'
uses: './.github/actions/push-changes'
with:
commit-message: 'Formatted csharp files'