| name: CodeQL Analysis (Reusable) |
|
|
| on: |
| workflow_call: |
| inputs: |
| runner_os: |
| description: 'Runner OS for CodeQL analysis' |
| type: string |
| required: false |
| default: ubuntu-latest |
|
|
| permissions: |
| actions: read |
| contents: read |
| security-events: write |
|
|
| env: |
| DOTNET_CLI_TELEMETRY_OPTOUT: 1 |
| DOTNET_NOLOGO: 1 |
| POWERSHELL_TELEMETRY_OPTOUT: 1 |
| __SuppressAnsiEscapeSequences: 1 |
| nugetMultiFeedWarnLevel: none |
|
|
| jobs: |
| analyze: |
| name: Analyze |
| runs-on: ${{ inputs.runner_os }} |
|
|
| strategy: |
| fail-fast: false |
| matrix: |
| |
| |
| language: ['csharp'] |
| |
| |
|
|
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| with: |
| fetch-depth: '0' |
|
|
| - uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 |
| with: |
| global-json-file: ./global.json |
|
|
| |
| - name: Initialize CodeQL |
| uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 |
| with: |
| languages: ${{ matrix.language }} |
| |
| |
| |
| |
|
|
| - run: | |
| Import-Module .\tools\ci.psm1 |
| Show-Environment |
| name: Capture Environment |
| shell: pwsh |
|
|
| - run: | |
| Import-Module .\tools\ci.psm1 |
| Invoke-CIInstall -SkipUser |
| name: Bootstrap |
| shell: pwsh |
|
|
| - run: | |
| Import-Module .\tools\ci.psm1 |
| Invoke-CIBuild -Configuration 'StaticAnalysis' |
| name: Build |
| shell: pwsh |
|
|
| - name: Perform CodeQL Analysis |
| uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 |
|
|