Skip to content

Commit

Permalink
Update codeql.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy95386 authored Jul 25, 2024
1 parent 2dd808b commit cc6021e
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions .github/workflows/codeql.yml
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 }}'

0 comments on commit cc6021e

Please sign in to comment.