1- name : " CodeQL"
1+ name : CodeQL
22
33on :
44 push :
5- branches : [ "main" ]
5+ branches :
6+ - main # Specify your target branch for analysis (main or master)
67 pull_request :
7- branches : [ "main" ]
8+ branches :
9+ - main
810
911jobs :
10- analyze :
11- name : Analyze
12- runs-on : ${{ matrix.language == 'swift' && 'macos-latest' || 'ubuntu-latest' }}
13- timeout-minutes : ${{ matrix.language == 'swift' && 120 || 360 }}
14- permissions :
15- actions : read
16- contents : read
17- security-events : write
18-
19- strategy :
20- fail-fast : false
21- matrix :
22- language : [ 'csharp', 'javascript-typescript' ]
23- dot-version : ['3.1.x']
12+ analysis :
13+ runs-on : ubuntu-latest # You can also use other OS types, like 'windows-latest' or 'macos-latest'
2414
2515 steps :
26- - name : Checkout repository
16+ - name : Checkout code
2717 uses : actions/checkout@v3
2818
29- - name : Install libssl-dev
30- run : sudo apt-get install -y libssl-dev
19+ - name : Set up .NET SDK
20+ uses : actions/setup-dotnet@v3
21+ with :
22+ dotnet-version : ' 6.0' # Specify the version of .NET Core you are using
3123
3224 - name : Install dependencies
3325 run : |
34- sudo apt-get update
35- sudo apt-get install -y libicu-dev libssl-dev ca-certificates openssl
36-
37- - name : Set System.Globalization.Invariant to true
38- run : echo "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1" >> $GITHUB_ENV
26+ dotnet restore # Restore the NuGet packages
3927
40- - name : Setup dotnet ${{ matrix.dot-version }}
41- uses : actions/setup-dotnet@v3
42- with :
43- dotnet-version : ${{ matrix.dot-version }}
44-
45- - name : Display dotnet version
46- run : dotnet --version
28+ - name : Build project
29+ run : |
30+ dotnet build --configuration Release --no-restore # Build the project without restoring dependencies again
4731
4832 - name : Initialize CodeQL
4933 uses : github/codeql-action/init@v2
5034 with :
51- languages : ${{ matrix.language }}
52-
53- - name : Build the C# project
54- if : matrix.language == 'csharp'
55- run : |
56- dotnet restore
57- dotnet build --configuration Release
35+ languages : ' csharp' # Specify 'csharp' for .NET Core
5836
5937 - name : Perform CodeQL Analysis
6038 uses : github/codeql-action/analyze@v2
6139 with :
62- category : " /language:${{matrix.language}} "
40+ category : ' security '
0 commit comments