.Net: Skipping formatting of excluded projects (#3941)

The `dotnet-format` workflow fails on temporarily excluded project
files:
- "Planners.Core.csproj"  
- "Planners.Core.UnitTests.csproj"  
- "Experimental.Orchestration.Flow.csproj"  
- "Experimental.Orchestration.Flow.UnitTests.csproj"  
- "Experimental.Orchestration.Flow.IntegrationTests.csproj"  
   
This PR excludes the projects from formatting.
This commit is contained in:
SergeyMenshykh
2023-12-05 01:25:35 +00:00
committed by GitHub
parent cb1293151c
commit 5e2f1b840e
+5 -1
View File
@@ -56,13 +56,17 @@ jobs:
if: github.event_name != 'pull_request' || steps.changed-files.outputs.added_modified != '' || steps.changed-files.outcome == 'failure'
run: |
csproj_files=()
exclude_files=("Planners.Core.csproj" "Planners.Core.UnitTests.csproj" "Experimental.Orchestration.Flow.csproj" "Experimental.Orchestration.Flow.UnitTests.csproj" "Experimental.Orchestration.Flow.IntegrationTests.csproj")
if [[ ${{ steps.changed-files.outcome }} == 'success' ]]; then
for file in ${{ steps.changed-files.outputs.added_modified }}; do
echo "$file was changed"
dir="./$file"
while [[ $dir != "." && $dir != "/" && $dir != $GITHUB_WORKSPACE ]]; do
if find "$dir" -maxdepth 1 -name "*.csproj" -print -quit | grep -q .; then
csproj_files+=("$(find "$dir" -maxdepth 1 -name "*.csproj" -print -quit)")
csproj_path="$(find "$dir" -maxdepth 1 -name "*.csproj" -print -quit)"
if [[ ! "${exclude_files[@]}" =~ "${csproj_path##*/}" ]]; then
csproj_files+=("$csproj_path")
fi
break
fi