Skip to content

Commit 4407d19

Browse files
combine pr and push analysis files to remove warning about not having on.push trigger. include script changes and file change for testing
1 parent 60f428a commit 4407d19

File tree

4 files changed

+61
-74
lines changed

4 files changed

+61
-74
lines changed

.github/scripts/Build-ChangedSamples.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ foreach ($file in $ChangedFiles) {
2525
if ($filename -eq "Build-AllSamples.ps1" -or $filename -eq "Build-Sample.ps1" -or $filename -eq "Build-SampleSet.ps1" -or $filename -eq "exclusions.csv" -or $filename -eq "Directory.Build.props" -or $filename -eq "packages.config") {
2626
$buildAll = $true
2727
}
28-
if ($dir -like "$root\.github\scripts" -or $dir -like "$root\.github\scripts\*") {
29-
$buildAll = $true
30-
}
31-
if ($dir -like "$root\.github\workflows" -or $dir -like "$root\.github\workflows\*") {
32-
$buildAll = $true
33-
}
28+
# if ($dir -like "$root\.github\scripts" -or $dir -like "$root\.github\scripts\*") {
29+
# $buildAll = $true
30+
# }
31+
# if ($dir -like "$root\.github\workflows" -or $dir -like "$root\.github\workflows\*") {
32+
# $buildAll = $true
33+
# } // Testing. Uncomment this when done
3434
if ($buildAll)
3535
{
3636
Write-Verbose "`u{2754} Full build triggered by change in file $file"

.github/workflows/Code-Scanning-pr.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/Code-Scanning.yml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,22 @@ on:
1111
paths-ignore:
1212
- '**.md'
1313
- 'LICENSE'
14+
pull_request:
15+
# The branches below must be a subset of the branches above
16+
branches:
17+
- main
18+
- develop
19+
paths-ignore:
20+
- '**.md'
21+
- 'LICENSE'
1422

1523
# Allow manual scheduling
1624
workflow_dispatch:
1725

1826
jobs:
19-
analyze:
20-
name: Analysis
27+
analyze-push:
28+
name: Analysis-Push
29+
if: github.event_name == 'push'
2130
runs-on: windows-latest
2231
permissions:
2332
actions: read
@@ -54,3 +63,46 @@ jobs:
5463
uses: github/codeql-action/analyze@v3
5564
with:
5665
category: "/language:${{matrix.language}}"
66+
analyze-pr:
67+
name: Analysis-PR
68+
if: github.event_name == 'pull_request'
69+
runs-on: windows-latest
70+
permissions:
71+
actions: read
72+
contents: read
73+
security-events: write
74+
75+
strategy:
76+
fail-fast: false
77+
matrix:
78+
include:
79+
- language: c-cpp
80+
build-mode: manual
81+
82+
steps:
83+
- name: Checkout repository
84+
uses: actions/checkout@v4
85+
with:
86+
submodules: 'recursive'
87+
- name: Install Nuget Packages
88+
run: nuget restore .\packages.config -PackagesDirectory .\packages\
89+
- name: Get changed files
90+
id: get-changed-files
91+
uses: tj-actions/changed-files@v41
92+
with:
93+
separator: ","
94+
- name: Initialize CodeQL
95+
uses: github/codeql-action/init@v3
96+
with:
97+
languages: ${{ matrix.language }}
98+
build-mode: ${{ matrix.build-mode }}
99+
config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development
100+
packs: +microsoft/windows-drivers@1.2.0-beta
101+
- if: matrix.build-mode == 'manual'
102+
run: |
103+
$changedFiles = "${{ steps.get-changed-files.outputs.all_changed_files }}".Split(',')
104+
.\.github\scripts\Build-ChangedSamples.ps1 -ChangedFiles $changedFiles -Verbose
105+
- name: Perform CodeQL analysis
106+
uses: github/codeql-action/analyze@v3
107+
with:
108+
category: "/language:${{matrix.language}}"

tools/sdv/samples/SDV-FailDriver-WDM/driver/fail_driver1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Module Name:
3333
#pragma alloc_text (PAGE, DispatchPnp)
3434
#pragma alloc_text (PAGE, DriverUnload)
3535
#endif
36-
36+
// test changing file for workflow update
3737
NTSTATUS
3838
DriverEntry(
3939
_In_ PDRIVER_OBJECT DriverObject,

0 commit comments

Comments
 (0)