forked from mkaring/ConfuserEx
-
Notifications
You must be signed in to change notification settings - Fork 4
35 lines (31 loc) · 987 Bytes
/
Copy pathformat.yml
File metadata and controls
35 lines (31 loc) · 987 Bytes
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
name: format
on:
pull_request:
branches: [master, pre-release]
paths: ['**.cs', '**.vb', '.editorconfig']
jobs:
check-format:
runs-on: windows-2025
timeout-minutes: 5
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- name: Check formatting
run: dotnet format Confuser2.sln --verify-no-changes --verbosity diagnostic
continue-on-error: true
id: format-check
- name: Format diff
if: steps.format-check.outcome == 'failure'
shell: pwsh
run: |
dotnet format Confuser2.sln
git diff --stat
$diff = git diff --name-only
if ($diff) {
Write-Host "::warning::The following files need formatting:" -ForegroundColor Yellow
$diff | ForEach-Object { Write-Host " $_" }
Write-Host ""
Write-Host "Run 'dotnet format Confuser2.sln' locally and commit the changes."
exit 1
}