Skip to content

Commit a3a06e0

Browse files
author
Petr Sramek
committed
updated workflow
1 parent 57081c4 commit a3a06e0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,28 @@ jobs:
3737
dotnet-version: ${{ vars.DOTNET_SDK_VERSION }}
3838
- name: Install dotnet-format tool
3939
run: dotnet tool install -g dotnet-format
40-
- run: |
40+
- name: Validate with .NET ${{ vars.DOTNET_SDK_VERSION }}
41+
run: |
4142
dotnet format whitespace --verify-no-changes --verbosity diagnostic
4243
dotnet format style --verify-no-changes --verbosity diagnostic
4344
dotnet format analyzers --verify-no-changes --diagnostics IDE0073 --verbosity diagnostic
4445
id: validate
4546
continue-on-error: true
4647
working-directory: ${{ github.workspace }}
47-
- run: |
48+
- name: Format with .NET ${{ vars.DOTNET_SDK_VERSION }}
49+
if: ${{ steps.validate.outcome != 'success' }}"
50+
run: |
4851
dotnet format whitespace --verbosity diagnostic
4952
dotnet format style --verbosity diagnostic
5053
dotnet format analyzers --diagnostics IDE0073 --verbosity diagnostic
51-
name: Apply style formatting and file header rule
52-
if: ${{ steps.validate.outcome != 'success' }}"
5354
working-directory: ${{ github.workspace }}
54-
- run: |
55+
- name: Push to ${{ github.ref }}
56+
if: ${{ steps.validate.outcome != 'success' }}"
57+
run: |
5558
git add .
5659
git config user.name "$(git log -n 1 --pretty=format:%an)"
5760
git config user.email "$(git log -n 1 --pretty=format:%ae)"
5861
git commit -m "applied file header rule"
5962
git pull origin ${{ github.ref }}
6063
git push origin ${{ github.ref }}
61-
name: Push style formatting and file header rule to ${{ github.ref }}
62-
if: ${{ steps.validate.outcome != 'success' }}"
6364
working-directory: ${{ github.workspace }}

0 commit comments

Comments
 (0)