Skip to content

Commit

Permalink
Handle cases of actual dotnet-format failures!
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeage committed May 27, 2024
1 parent 5b5e02c commit a2caaa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Run pre-commit dotnet-format, with retries
uses: Wandalen/wretry.action@v3
with:
command: pre-commit run dotnet-format --show-diff-on-failure --color=always --all-files
command: pre-commit run dotnet-format --show-diff-on-failure --color=always --all-files || git checkout -- . # In case dotnet-format fails, reset the changes it made. This way, we can differentiate between a NuGet failure and a real formatting issue
- name: Remove dotnet-format from the list of pre-commit jobs to run (since we already ran it)
run: yq eval 'del(.repos[] | select(.hooks[].id == "dotnet-format"))' -i .pre-commit-config.yaml
- name: Run the rest of pre-commit
Expand Down

0 comments on commit a2caaa9

Please sign in to comment.