This file contains hidden or 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 Security Analysis | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| schedule: | |
| - cron: '0 0 * * 1' # Every Monday at midnight | |
| workflow_dispatch: | |
| jobs: | |
| analyze: | |
| name: π Analyze ${{ matrix.language }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| packages: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: [ 'csharp', 'javascript' ] | |
| steps: | |
| - name: π₯ Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: π§ Setup .NET | |
| if: matrix.language == 'csharp' | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '7.0.x' | |
| - name: βοΈ Initialize CodeQL | |
| uses: github/codeql-action/init@v3 | |
| with: | |
| languages: ${{ matrix.language }} | |
| queries: security-extended,security-and-quality | |
| - name: ποΈ Build C# Projects | |
| if: matrix.language == 'csharp' | |
| run: | | |
| echo "π¦ Restoring dependencies..." | |
| dotnet restore JsonViewer.Blazor.sln | |
| echo "ποΈ Building Component..." | |
| dotnet build src/Component/Component.csproj -c Release --no-restore | |
| echo "ποΈ Building Demo..." | |
| dotnet build src/Blazor.Demo/Blazor.Demo.csproj -c Release --no-restore | |
| echo "β Build completed" | |
| - name: ποΈ Autobuild JavaScript | |
| if: matrix.language == 'javascript' | |
| uses: github/codeql-action/autobuild@v3 | |
| - name: π Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v3 | |
| with: | |
| category: "/language:${{ matrix.language }}" |