MegaBites-AI/Windows-powershell
0372
1name: CodeQL Analysis (Reusable)2 3on:4 workflow_call:5 inputs:6 runner_os:7 description: 'Runner OS for CodeQL analysis'8 type: string9 required: false10 default: ubuntu-latest11 12permissions:13 actions: read # for github/codeql-action/init to get workflow details14 contents: read # for actions/checkout to fetch code15 security-events: write # for github/codeql-action/analyze to upload SARIF results16 17env:18 DOTNET_CLI_TELEMETRY_OPTOUT: 119 DOTNET_NOLOGO: 120 POWERSHELL_TELEMETRY_OPTOUT: 121 __SuppressAnsiEscapeSequences: 122 nugetMultiFeedWarnLevel: none23 24jobs:25 analyze:26 name: Analyze27 runs-on: ${{ inputs.runner_os }}28 29 strategy:30 fail-fast: false31 matrix:32 # Override automatic language detection by changing the below list33 # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']34 language: ['csharp']35 # Learn more...36 # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection37 38 steps:39 - name: Checkout repository40 uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.241 with:42 fetch-depth: '0'43 44 - uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.045 with:46 global-json-file: ./global.json47 48 # Initializes the CodeQL tools for scanning.49 - name: Initialize CodeQL50 uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.551 with:52 languages: ${{ matrix.language }}53 # If you wish to specify custom queries, you can do so here or in a config file.54 # By default, queries listed here will override any specified in a config file.55 # Prefix the list here with "+" to use these queries and those in the config file.56 # queries: ./path/to/local/query, your-org/your-repo/queries@main57 58 - run: |59 Import-Module .\tools\ci.psm160 Show-Environment61 name: Capture Environment62 shell: pwsh63 64 - run: |65 Import-Module .\tools\ci.psm166 Invoke-CIInstall -SkipUser67 name: Bootstrap68 shell: pwsh69 70 - run: |71 Import-Module .\tools\ci.psm172 Invoke-CIBuild -Configuration 'StaticAnalysis'73 name: Build74 shell: pwsh75 76 - name: Perform CodeQL Analysis77 uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.578 