From a76ae49f894ed2feea16b7c0553b8a489d93de55 Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 14:08:20 +0100 Subject: [PATCH 01/10] Create codeql.yml --- .github/workflows/codeql.yml | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..9cb00a8 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,67 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '16 23 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: 'windows-latest' + timeout-minutes: 360 + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'csharp' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" From 9f10e887ed093594862b05c570f2ecf7da2fdadc Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 14:21:28 +0100 Subject: [PATCH 02/10] Don't use autobuild in codeql.yml --- .github/workflows/codeql.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9cb00a8..3505557 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -48,8 +48,8 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + # - name: Autobuild + # uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -60,6 +60,11 @@ jobs: # - run: | # echo "Run, Build Application using script" # ./location_of_script_within_repo/buildscript.sh + + - name: Build + shell: pwsh + run: | + ./src/build.ps1 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 From aac24d86d7af068526907a8fea3c2dd3e176ca1a Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 14:25:36 +0100 Subject: [PATCH 03/10] Update codeql.yml --- .github/workflows/codeql.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 3505557..5fba29a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -64,7 +64,8 @@ jobs: - name: Build shell: pwsh run: | - ./src/build.ps1 + CD.. + ./build.ps1 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 From cb381b71b4ead72d7f5afb1004178c789af19458 Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 14:31:06 +0100 Subject: [PATCH 04/10] Update codeql.yml --- .github/workflows/codeql.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5fba29a..bd7ed65 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -64,8 +64,7 @@ jobs: - name: Build shell: pwsh run: | - CD.. - ./build.ps1 + ./src/build.ps1 -Script ./src/build.cake -Target Build -Verbosity Verbose - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 From d102eb2b2d3ba108a45b9804dc4691ecb178f902 Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 14:36:56 +0100 Subject: [PATCH 05/10] Update build.ps1 --- src/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.ps1 b/src/build.ps1 index c6c91b2..6d94a9a 100644 --- a/src/build.ps1 +++ b/src/build.ps1 @@ -231,7 +231,7 @@ if (!(Test-Path $CAKE_EXE)) { $cakeArguments = @("$Script"); if ($Target) { $cakeArguments += "-target=$Target" } if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } -if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } +if ($Verbosity) { $cakeArguments += "-msbuild-verbosity=$Verbosity" } if ($ShowDescription) { $cakeArguments += "-showdescription" } if ($DryRun) { $cakeArguments += "-dryrun" } $cakeArguments += $ScriptArgs From a33038134b83193ca84bf9b8c2a2602d90020a03 Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 14:43:56 +0100 Subject: [PATCH 06/10] Update build.ps1 --- src/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.ps1 b/src/build.ps1 index 6d94a9a..88a0199 100644 --- a/src/build.ps1 +++ b/src/build.ps1 @@ -231,7 +231,7 @@ if (!(Test-Path $CAKE_EXE)) { $cakeArguments = @("$Script"); if ($Target) { $cakeArguments += "-target=$Target" } if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } -if ($Verbosity) { $cakeArguments += "-msbuild-verbosity=$Verbosity" } +if ($Verbosity) { $cakeArguments += "--msbuild-verbosity=$Verbosity" } if ($ShowDescription) { $cakeArguments += "-showdescription" } if ($DryRun) { $cakeArguments += "-dryrun" } $cakeArguments += $ScriptArgs From e515d27ab2b1e9d18a561225ca3788acd5dd1ef2 Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 14:44:53 +0100 Subject: [PATCH 07/10] Update build.ps1 --- src/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.ps1 b/src/build.ps1 index 88a0199..c6c91b2 100644 --- a/src/build.ps1 +++ b/src/build.ps1 @@ -231,7 +231,7 @@ if (!(Test-Path $CAKE_EXE)) { $cakeArguments = @("$Script"); if ($Target) { $cakeArguments += "-target=$Target" } if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } -if ($Verbosity) { $cakeArguments += "--msbuild-verbosity=$Verbosity" } +if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } if ($ShowDescription) { $cakeArguments += "-showdescription" } if ($DryRun) { $cakeArguments += "-dryrun" } $cakeArguments += $ScriptArgs From 324dbcc2b9182fbd4e85416208faf1a0bb4c648b Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 14:46:56 +0100 Subject: [PATCH 08/10] Update codeql.yml --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bd7ed65..64a27c0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -64,7 +64,7 @@ jobs: - name: Build shell: pwsh run: | - ./src/build.ps1 -Script ./src/build.cake -Target Build -Verbosity Verbose + ./src/build.ps1 -Script ./src/build.cake - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 From 53f7761ad5a3c4eb647f7f5248fc592613b42d20 Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 15:01:32 +0100 Subject: [PATCH 09/10] Update codeql.yml --- .github/workflows/codeql.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 64a27c0..dccc833 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -23,7 +23,7 @@ on: jobs: analyze: name: Analyze - runs-on: 'windows-latest' + runs-on: 'windows-2019' timeout-minutes: 360 permissions: actions: read @@ -64,7 +64,8 @@ jobs: - name: Build shell: pwsh run: | - ./src/build.ps1 -Script ./src/build.cake + Set-Location -Path .\src + ./build.ps1 -Script ./build.cake -Target Build --msbuild-verbosity=Verbose - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 From 294451211692ef94ff1b6c813e467655b2a4a2e5 Mon Sep 17 00:00:00 2001 From: Gabriela Georgieva Date: Fri, 10 Nov 2023 15:04:27 +0100 Subject: [PATCH 10/10] Update codeql.yml --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index dccc833..504bdc8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -65,7 +65,7 @@ jobs: shell: pwsh run: | Set-Location -Path .\src - ./build.ps1 -Script ./build.cake -Target Build --msbuild-verbosity=Verbose + ./build.ps1 -Script ./build.cake --msbuild-verbosity=Verbose - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2