Skip to content

Commit

Permalink
Enable manual build in CodeQL action (#20)
Browse files Browse the repository at this point in the history
* Enable manual build
  • Loading branch information
kirill-abblix authored Nov 14, 2024
1 parent 66e1f0b commit 0c19d9a
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
matrix:
include:
- language: csharp
build-mode: autobuild
build-mode: manual
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
Expand All @@ -71,21 +71,20 @@ jobs:
# 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
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ 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: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
# Custom manual build steps for C# using dotnet
- if: matrix.build-mode == 'manual' && matrix.language == 'csharp'
name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x' # Adjust if you're using a different .NET version

- if: matrix.build-mode == 'manual' && matrix.language == 'csharp'
name: Restore dependencies
run: dotnet restore

- if: matrix.build-mode == 'manual' && matrix.language == 'csharp'
name: Build the code
run: dotnet build --no-restore

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down

0 comments on commit 0c19d9a

Please sign in to comment.