File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ concurrency:
22
22
cancel-in-progress : false
23
23
24
24
jobs :
25
- versioning :
25
+ formatting :
26
26
name : Format file headers with .NET ${{ vars.DOTNET_SDK_VERSION }}
27
27
runs-on : ubuntu-latest
28
28
steps :
@@ -33,11 +33,20 @@ jobs:
33
33
uses : actions/setup-dotnet@v4
34
34
with :
35
35
dotnet-version : ${{ vars.DOTNET_SDK_VERSION }}
36
+ - run : |
37
+ dotnet format whitespace --no-restore --verify-no-changes --verbosity diagnostic
38
+ dotnet format style --no-restore --verify-no-changes --verbosity diagnostic
39
+ dotnet format analyzers --no-restore --verify-no-changes --diagnostics IDE0073 --verbosity diagnostic
40
+ echo "has-changes=true" >> "$GITHUB_OUTPUT"
41
+ id: validate
42
+ continue-on-error: true
43
+ working-directory: ${{ github.workspace }}
36
44
- run : |
37
45
dotnet format whitespace
38
46
dotnet format style
39
47
dotnet format analyzers --no-restore --diagnostics IDE0073 --verbosity diagnostic
40
48
name: Apply style formatting and file header rule
49
+ if: ${{ steps.validate.output.has-changes != true }}
41
50
working-directory: ${{ github.workspace }}
42
51
- run : |
43
52
git add .
47
56
git pull origin ${{ github.ref }}
48
57
git push origin ${{ github.ref }}
49
58
name: Push style formatting and file header rule to ${{ github.ref }}
59
+ if: ${{ steps.validate.output.has-changes != true }}
50
60
working-directory: ${{ github.workspace }}
You can’t perform that action at this time.
0 commit comments