CodeQL Analysis #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CodeQL Analysis" | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
analyze: | |
name: Analyze | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v2 | |
with: | |
languages: csharp | |
- name: Restore NuGet Packages | |
run: cd SM-Post && nuget restore | |
- name: Build | |
run: cd SM-Post && dotnet build --no-restore --configuration Release | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v2 | |
with: | |
languages: csharp | |
paths: "." # Scan the entire repository by default | |
# To include additional queries or QL packs, you can use the 'additional-queries' option. | |
# Example: | |
# additional-queries: > | |
# https://github.com/your-org/your-repo/queries/csharp/your-custom-queries.qls | |
# To fail the analysis if any alerts are found, set the 'fail-on-alert' option to true. | |
# fail-on-alert: true |