Skip to content

Commit b3b165b

Browse files
Merge pull request #37 from microsoft/u/sgriffin/codeql
U/sgriffin/codeql
2 parents 738550b + f1c1711 commit b3b165b

3 files changed

Lines changed: 46 additions & 13 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1-
name: "CodeQL"
1+
name: "CodeQL Advanced"
22

33
on:
44
workflow_dispatch:
5+
push:
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
59
schedule:
6-
- cron: "0 0 * * 1"
7-
8-
permissions:
9-
contents: read
10+
- cron: '33 1 * * 2'
1011

1112
jobs:
1213
analyze:
13-
name: Analyze
14+
name: Analyze (${{ matrix.language }})
15+
# Runner size impacts CodeQL analysis time. To learn more, please see:
16+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
17+
# - https://gh.io/supported-runners-and-hardware-resources
18+
# - https://gh.io/using-larger-runners (GitHub.com only)
19+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
1420
runs-on: windows-latest
1521
permissions:
22+
packages: read
1623
actions: read
1724
contents: read
1825
security-events: write
1926

2027
strategy:
2128
fail-fast: false
2229
matrix:
23-
language: ["cpp"]
24-
30+
include:
31+
- language: c-cpp
32+
build-mode: autobuild
2533
steps:
2634
- name: Harden Runner
2735
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
@@ -32,17 +40,30 @@ jobs:
3240
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3341
with:
3442
submodules: 'recursive'
35-
43+
3644
# Initializes the CodeQL tools for scanning.
3745
- name: Initialize CodeQL
3846
uses: github/codeql-action/init@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
3947
with:
4048
languages: ${{ matrix.language }}
49+
build-mode: ${{ matrix.build-mode }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
4153

42-
- name: Autobuild
43-
uses: github/codeql-action/autobuild@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
54+
# 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
55+
# queries: security-extended,security-and-quality
56+
57+
# - name: Autobuild
58+
# uses: github/codeql-action/autobuild@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
4459

4560
- name: Perform CodeQL Analysis
61+
id: analyze
4662
uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
4763
with:
48-
category: "/language:${{matrix.language}}"
64+
category: "/language:${{matrix.language}}"
65+
66+
- name: Upload CodeQL Analysis Results
67+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
68+
with:
69+
path: ${{ steps.analyze.outputs.sarif-output }}

.github/workflows/devskim.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ jobs:
3131
- name: Upload DevSkim scan results to GitHub Security tab
3232
uses: github/codeql-action/upload-sarif@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
3333
with:
34-
sarif_file: devskim-results.sarif
34+
sarif_file: devskim-results.sarif
35+
36+
- name: Upload DevSkim scan results as an artifact
37+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
38+
with:
39+
path: devskim-results.sarif

.github/workflows/github-ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,17 @@ jobs:
4444
& $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="${{matrix.configuration}}" /p:Platform="${{matrix.platform}}" mapistub.sln
4545
4646
- name: Perform CodeQL Analysis
47+
id: analyze
4748
uses: github/codeql-action/analyze@4f3212b61783c3c68e8309a0f18a699764811cda # v3.27.1
4849
with:
4950
category: "/language:cpp"
5051

52+
- name: Upload CodeQL Analysis Results
53+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
54+
with:
55+
name: codeql-results-${{ matrix.configuration }}-${{ matrix.platform }}
56+
path: ${{ steps.analyze.outputs.sarif-output }}
57+
5158
publish-test-results:
5259
name: "Publish Tests Results"
5360
needs: build

0 commit comments

Comments
 (0)