Skip to content

Commit 15f53d9

Browse files
update workflow for sln
1 parent 1a9bf6d commit 15f53d9

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,16 @@ jobs:
5353
- name: Build the C# project
5454
if: matrix.language == 'csharp'
5555
run: |
56-
dotnet restore
57-
dotnet build --configuration Release
56+
# Find the solution or project file and build it
57+
solution_file=$(find . -name "*.sln" -print -quit)
58+
if [ -z "$solution_file" ]; then
59+
project_file=$(find . -name "*.csproj" -print -quit)
60+
dotnet restore $project_file
61+
dotnet build --configuration Release $project_file
62+
else
63+
dotnet restore $solution_file
64+
dotnet build --configuration Release $solution_file
65+
fi
5866
5967
- name: Perform CodeQL Analysis
6068
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)