1- name : " CodeQL"
1+ name : " CodeQL Advanced "
22
33on :
4+ workflow_dispatch :
45 push :
56 branches : [ "main" ]
67 pull_request :
7- # The branches below must be a subset of the branches above
88 branches : [ "main" ]
99 schedule :
10- - cron : ' 33 10 * * 4'
10+ - cron : ' 33 10 * * 4' # Run every Thursday at 10:33 UTC
11+
12+ permissions :
13+ contents : read
1114
1215jobs :
1316 analyze :
14- name : Analyze
15- runs-on : ${{ 'windows-latest' }}
16- timeout-minutes : ${{ 360 }}
17+ name : Analyze (${{ matrix.language }})
18+ runs-on : windows-latest
1719 permissions :
20+ packages : read
1821 actions : read
1922 contents : read
2023 security-events : write
@@ -25,52 +28,70 @@ jobs:
2528 language : [ 'csharp' ]
2629
2730 steps :
28- - name : Checkout repository
29- uses : actions/checkout@v3
30-
31- # Initializes the CodeQL tools for scanning.
32- - name : Initialize CodeQL
33- uses : github/codeql-action/init@v2
34- with :
35- languages : ${{ matrix.language }}
31+ - name : Harden Runner
32+ uses : step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
33+ with :
34+ egress-policy : audit
3635
37- - name : Machine setup
38- shell : pwsh
39- run : ./scripts/machine-setup.ps1
36+ - name : Checkout repository
37+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+ with :
39+ submodules : ' recursive'
4040
41- - name : Restore NuGet packages
42- working-directory : ${{ github.workspace }}
43- run : |
44- nuget restore ./MAPIInspector/Source/MAPIInspector.sln
45- nuget restore ./MAPIInspector/Test/MAPIAutomationTest/MAPIAutomationTest.sln
46- nuget restore ./FSSHTTPWOPIInspector/Source/FSSHTTPandWOPIInspector.sln
47- nuget restore ./FSSHTTPWOPIInspector/Test/WOPIautomation/WOPIautomation.sln
41+ # Initializes the CodeQL tools for scanning.
42+ - name : Initialize CodeQL
43+ uses : github/codeql-action/init@396bb3e45325a47dd9ef434068033c6d5bb0d11a # v3.27.3
44+ with :
45+ languages : ${{ matrix.language }}
46+ # If you wish to specify custom queries, you can do so here or in a config file.
47+ # By default, queries listed here will override any specified in a config file.
48+ # Prefix the list here with "+" to use these queries and those in the config file.
4849
49- - name : " Build MAPIInspector"
50- shell : pwsh
51- run : |
52- $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
53- & $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="Release" ./MAPIInspector/Source/MAPIInspector.sln
50+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
51+ # queries: security-extended,security-and-quality
5452
55- - name : " Build MAPIAutomationTest"
56- shell : pwsh
57- run : |
58- $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
59- & $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="Release" ./MAPIInspector/Test/MAPIAutomationTest/MAPIAutomationTest.sln
53+ - name : Machine setup
54+ shell : pwsh
55+ run : ./scripts/machine-setup.ps1
56+
57+ - name : Restore NuGet packages
58+ working-directory : ${{ github.workspace }}
59+ run : |
60+ nuget restore ./MAPIInspector/Source/MAPIInspector.sln
61+ nuget restore ./MAPIInspector/Test/MAPIAutomationTest/MAPIAutomationTest.sln
62+ nuget restore ./FSSHTTPWOPIInspector/Source/FSSHTTPandWOPIInspector.sln
63+ nuget restore ./FSSHTTPWOPIInspector/Test/WOPIautomation/WOPIautomation.sln
64+
65+ - name : " Build MAPIInspector"
66+ shell : pwsh
67+ run : |
68+ $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
69+ & $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="Release" ./MAPIInspector/Source/MAPIInspector.sln
70+
71+ - name : " Build MAPIAutomationTest"
72+ shell : pwsh
73+ run : |
74+ $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
75+ & $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="Release" ./MAPIInspector/Test/MAPIAutomationTest/MAPIAutomationTest.sln
76+
77+ - name : " Build FSSHTTPandWOPIInspector"
78+ shell : pwsh
79+ run : |
80+ $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
81+ & $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="Release" ./FSSHTTPWOPIInspector/Source/FSSHTTPandWOPIInspector.sln
82+
83+ - name : " Build WOPIautomation"
84+ shell : pwsh
85+ run : |
86+ $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
87+ & $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="Release" ./FSSHTTPWOPIInspector/Test/WOPIautomation/WOPIautomation.sln
6088
61- - name : " Build FSSHTTPandWOPIInspector"
62- shell : pwsh
63- run : |
64- $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
65- & $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="Release" ./FSSHTTPWOPIInspector/Source/FSSHTTPandWOPIInspector.sln
89+ - name : Perform CodeQL Analysis
90+ uses : github/codeql-action/analyze@396bb3e45325a47dd9ef434068033c6d5bb0d11a # v3.27.3
91+ with :
92+ category : " /language:${{matrix.language}}"
6693
67- - name : " Build WOPIautomation"
68- shell : pwsh
69- run : |
70- $path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
71- & $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="Release" ./FSSHTTPWOPIInspector/Test/WOPIautomation/WOPIautomation.sln
72-
73- - name : Perform CodeQL Analysis
74- uses : github/codeql-action/analyze@v2
75- with :
76- category : " /language:${{matrix.language}}"
94+ - name : Upload CodeQL Analysis Results
95+ uses : actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
96+ with :
97+ path : ${{ steps.analyze.outputs.sarif-output }}
0 commit comments