Merge pull request #3003 from Youssef1313/copilot/backport-pr-2994-to… #7125
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 Analysis | |
| on: | |
| push: | |
| branches: [ main, support/v1, support/v2 ] | |
| pull_request: | |
| schedule: | |
| - cron: '0 8 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read # these permissions are required to run the codeql analysis | |
| actions: read | |
| security-events: write | |
| jobs: | |
| analyze: | |
| name: CodeQL Analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| id: checkout_repo | |
| uses: actions/checkout@v6 | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Setup .NET 10 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Initialize CodeQL | |
| id: init_codeql | |
| uses: github/codeql-action/init@v4 | |
| with: | |
| queries: security-and-quality | |
| - name: Build projects | |
| id: build_projects | |
| shell: pwsh | |
| run: | | |
| $projectsArray = @( | |
| '.\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj', | |
| '.\src\Microsoft.OpenApi.YamlReader\Microsoft.OpenApi.YamlReader.csproj', | |
| '.\src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj' | |
| ) | |
| $projectsArray | ForEach-Object { | |
| dotnet build $PSItem -c Release | |
| } | |
| - name: Perform CodeQL Analysis | |
| id: analyze_codeql | |
| uses: github/codeql-action/analyze@v4 | |
| # Built with ❤ by [Pipeline Foundation](https://pipeline.foundation) |