@@ -37,23 +37,32 @@ jobs:
37
37
dotnet-version : ${{ vars.DOTNET_SDK_VERSION }}
38
38
- name : Install dotnet-format tool
39
39
run : dotnet tool install -g dotnet-format
40
- - name : Validate with .NET ${{ vars.DOTNET_SDK_VERSION }}
41
- run : |
42
- dotnet format whitespace --verify-no-changes --verbosity diagnostic
43
- dotnet format style --verify-no-changes --verbosity diagnostic
44
- dotnet format analyzers --verify-no-changes --diagnostics IDE0073 --verbosity diagnostic
45
- id : validate
46
- continue-on-error : true
47
- working-directory : ${{ github.workspace }}
40
+ # - name: Validate with .NET ${{ vars.DOTNET_SDK_VERSION }}
41
+ # run: |
42
+ # dotnet format whitespace --verify-no-changes --verbosity diagnostic
43
+ # dotnet format style --verify-no-changes --verbosity diagnostic
44
+ # dotnet format analyzers --verify-no-changes --diagnostics IDE0073 --verbosity diagnostic
45
+ # id: validate
46
+ # continue-on-error: true
47
+ # working-directory: ${{ github.workspace }}
48
48
- name : Format with .NET ${{ vars.DOTNET_SDK_VERSION }}
49
- if : ${{ steps.validate.outcome != 'success ' }}"
49
+ if : ${{ steps.validate.outcome == 'failure ' }}"
50
50
run : |
51
51
dotnet format whitespace --verbosity diagnostic
52
52
dotnet format style --verbosity diagnostic
53
53
dotnet format analyzers --diagnostics IDE0073 --verbosity diagnostic
54
54
working-directory : ${{ github.workspace }}
55
+ - name : Validate with .NET ${{ vars.DOTNET_SDK_VERSION }}
56
+ run : |
57
+ git diff --quiet --exit-code --cached
58
+ echo $?
59
+ echo 'has-changes=$?' >> $GITHUB_OUTPUT
60
+ echo ${{ steps.validate.output.has-changes }}
61
+ id : validate
62
+ continue-on-error : true
63
+ working-directory : ${{ github.workspace }}
55
64
- name : Push to ${{ github.ref }}
56
- if : ${{ steps.validate.outcome != 'success' }}"
65
+ if : ${{ fromJSON( steps.validate.output.has-changes) }}"
57
66
run : |
58
67
git add .
59
68
git config user.name "$(git log -n 1 --pretty=format:%an)"
0 commit comments