summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Ronstadt <[email protected]>2025-03-19 13:56:21 -0700
committerGitHub <[email protected]>2025-03-19 13:56:21 -0700
commitfb21b13a73457c8a68a7aca41d80e7f292929d1f (patch)
tree679d7dfdb3854027ba4aa1a68c39bdaecfffa0fa
parentcc8c10376cfb2432342730409644b025129b1a5f (diff)
update workflow files to split codeql analysis for push and PR (#1273)
* update workflow files to split codeql analysis for push and PR * test changing a file * remove build all option in script for testing. * Revert "remove build all option in script for testing." This reverts commit 04eb2c34aac69545b56ff86b6d642e453bde89f0. * Revert "test changing a file" This reverts commit d69205126f62ad44af4c5e3b64f1f14637116ea2. * combine pr and push analysis files to remove warning about not having on.push trigger. include script changes and file change for testing * remove test changes
-rw-r--r--.github/workflows/Code-Scanning.yml48
1 files changed, 46 insertions, 2 deletions
diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml
index 72e9c32c..e843271f 100644
--- a/.github/workflows/Code-Scanning.yml
+++ b/.github/workflows/Code-Scanning.yml
@@ -24,8 +24,9 @@ on:
workflow_dispatch:
jobs:
- analyze:
- name: Analysis
+ analyze-push:
+ name: Analysis-Push
+ if: github.event_name == 'push'
runs-on: windows-latest
permissions:
actions: read
@@ -62,3 +63,46 @@ jobs:
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
+ analyze-pr:
+ name: Analysis-PR
+ if: github.event_name == 'pull_request'
+ runs-on: windows-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - language: c-cpp
+ build-mode: manual
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ submodules: 'recursive'
+ - name: Install Nuget Packages
+ run: nuget restore .\packages.config -PackagesDirectory .\packages\
+ - name: Get changed files
+ id: get-changed-files
+ uses: tj-actions/changed-files@v41
+ with:
+ separator: ","
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+ build-mode: ${{ matrix.build-mode }}
+ config-file: microsoft/Windows-Driver-Developer-Supplemental-Tools/config/codeql-config.yml@development
+ packs: +microsoft/[email protected]
+ - if: matrix.build-mode == 'manual'
+ run: |
+ $changedFiles = "${{ steps.get-changed-files.outputs.all_changed_files }}".Split(',')
+ .\.github\scripts\Build-ChangedSamples.ps1 -ChangedFiles $changedFiles -Verbose
+ - name: Perform CodeQL analysis
+ uses: github/codeql-action/analyze@v3
+ with:
+ category: "/language:${{matrix.language}}" \ No newline at end of file