Skip to content

Commit 6f9e0f7

Browse files
author
Petr Sramek
committed
test
1 parent a3a06e0 commit 6f9e0f7

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

.github/workflows/format-cs-files.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,32 @@ jobs:
3737
dotnet-version: ${{ vars.DOTNET_SDK_VERSION }}
3838
- name: Install dotnet-format tool
3939
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 }}
4848
- name: Format with .NET ${{ vars.DOTNET_SDK_VERSION }}
49-
if: ${{ steps.validate.outcome != 'success' }}"
49+
if: ${{ steps.validate.outcome == 'failure' }}"
5050
run: |
5151
dotnet format whitespace --verbosity diagnostic
5252
dotnet format style --verbosity diagnostic
5353
dotnet format analyzers --diagnostics IDE0073 --verbosity diagnostic
5454
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 }}
5564
- name: Push to ${{ github.ref }}
56-
if: ${{ steps.validate.outcome != 'success' }}"
65+
if: ${{ fromJSON(steps.validate.output.has-changes) }}"
5766
run: |
5867
git add .
5968
git config user.name "$(git log -n 1 --pretty=format:%an)"

0 commit comments

Comments
 (0)