|
| 1 | +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json |
| 2 | + |
| 3 | +name: "CodeQL" |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + paths: |
| 8 | + - '**.cs' |
| 9 | + - '**.csproj' |
| 10 | + branches: [master] |
| 11 | + pull_request: |
| 12 | + paths: |
| 13 | + - '**.cs' |
| 14 | + - '**.csproj' |
| 15 | + # The branches below must be a subset of the branches above |
| 16 | + branches: [master] |
| 17 | + schedule: |
| 18 | + - cron: '32 11 * * 3' |
| 19 | + |
| 20 | +jobs: |
| 21 | + analyze: |
| 22 | + name: Analyze |
| 23 | + runs-on: ubuntu-latest |
| 24 | + env: |
| 25 | + DOTNET_CLI_TELEMETRY_OPTOUT: 1 |
| 26 | + DOTNET_DISABLE_GUI_ERRORS: 1 |
| 27 | + DOTNET_GENERATE_ASPNET_CERTIFICATE: 0 |
| 28 | + DOTNET_NOLOGO: 1 |
| 29 | + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 |
| 30 | + permissions: |
| 31 | + actions: read |
| 32 | + contents: read |
| 33 | + security-events: write |
| 34 | + |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + matrix: |
| 38 | + language: ['csharp'] |
| 39 | + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] |
| 40 | + # Learn more: https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed |
| 41 | + |
| 42 | + steps: |
| 43 | + - name: Checkout repository |
| 44 | + uses: actions/checkout@v3 |
| 45 | + with: |
| 46 | + fetch-depth: 2 |
| 47 | + |
| 48 | + # Initializes the CodeQL tools for scanning. |
| 49 | + - name: Initialize CodeQL |
| 50 | + uses: github/codeql-action/init@v2 |
| 51 | + 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@main |
| 57 | + |
| 58 | + - name: Setup .NET SDK |
| 59 | + uses: actions/setup-dotnet@v2 |
| 60 | + with: |
| 61 | + dotnet-version: 6.0.x |
| 62 | + include-prerelease: false |
| 63 | + |
| 64 | + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). |
| 65 | + # If this step fails, then you should remove it and run the build manually (see below) |
| 66 | + - name: Autobuild |
| 67 | + uses: github/codeql-action/autobuild@v2 |
| 68 | + |
| 69 | + # ℹ️ Command-line programs to run using the OS shell. |
| 70 | + # 📚 https://git.io/JvXDl |
| 71 | + |
| 72 | + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines |
| 73 | + # and modify them (or add more) to build your code if your project |
| 74 | + # uses a compiled language |
| 75 | + |
| 76 | + #- run: | |
| 77 | + # make bootstrap |
| 78 | + # make release |
| 79 | + |
| 80 | + - name: Perform CodeQL Analysis |
| 81 | + uses: github/codeql-action/analyze@v2 |
0 commit comments