-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2dd808b
commit cc6021e
Showing
1 changed file
with
20 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,36 @@ | ||
name: CodeQL Analysis | ||
name: CodeQL | ||
|
||
on: | ||
push: | ||
branches: [main] # Adjust the branch name as needed | ||
branches: [ main ] | ||
pull_request: | ||
branches: [main] # Adjust the branch name as needed | ||
branches: [ main ] | ||
schedule: | ||
- cron: '0 0 * * 1' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'javascript', 'html' ] | ||
|
||
- name: Set up .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '6.x' # Adjust the .NET version as needed | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install CodeQL CLI | ||
uses: github/codeql-action/setup-codeql@v2 | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: csharp | ||
|
||
- name: Build .NET project | ||
run: dotnet build --no-restore | ||
|
||
- name: Create CodeQL database | ||
run: codeql database create codeql-db --language=cs --source-root=. | ||
languages: ${{ matrix.language }} | ||
|
||
- name: Run CodeQL analysis | ||
run: codeql database analyze codeql-db --format=sarifv2.1.0 --output=codeql-results.sarif | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
- name: Upload CodeQL results | ||
uses: github/codeql-action/upload-sarif@v2 | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
with: | ||
sarif_file: codeql-results.sarif | ||
category: '/language:${{ matrix.language }}' |