|
| 1 | +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json |
| 2 | + |
| 3 | +name: "CodeQL C#" |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: ["master", "main"] |
| 8 | + pull_request: |
| 9 | + # The branches below must be a subset of the branches above |
| 10 | + branches: ["master", "main"] |
| 11 | + schedule: |
| 12 | + - cron: "27 4 * * 5" |
| 13 | + |
| 14 | +jobs: |
| 15 | + analyze: |
| 16 | + name: Analyze |
| 17 | + runs-on: ubuntu-latest |
| 18 | + permissions: |
| 19 | + actions: read |
| 20 | + contents: read |
| 21 | + security-events: write |
| 22 | + packages: read |
| 23 | + # required to fetch internal or private CodeQL packs |
| 24 | + |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + language: ["csharp"] |
| 29 | + |
| 30 | + steps: |
| 31 | + - name: Checkout repository |
| 32 | + uses: actions/checkout@v4 |
| 33 | + |
| 34 | + # Initializes the CodeQL tools for scanning. |
| 35 | + - name: Initialize CodeQL |
| 36 | + uses: github/codeql-action/init@v3 |
| 37 | + with: |
| 38 | + languages: ${{ matrix.language }} |
| 39 | + queries: security-extended # security-and-quality |
| 40 | + build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too. |
| 41 | + # If you wish to specify custom queries, you can do so here or in a config file. |
| 42 | + # By default, queries listed here will override any specified in a config file. |
| 43 | + # Prefix the list here with "+" to use these queries and those in the config file. |
| 44 | + |
| 45 | + # # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). |
| 46 | + # # If this step fails, then you should remove it and run the build manually (see below) |
| 47 | + # - name: Autobuild |
| 48 | + # uses: github/codeql-action/autobuild@v3 |
| 49 | + |
| 50 | + # ℹ️ Command-line programs to run using the OS shell. |
| 51 | + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
| 52 | + |
| 53 | + # If the Autobuild fails above, remove it and uncomment the following three lines. |
| 54 | + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. |
| 55 | + |
| 56 | + # - run: | |
| 57 | + # echo "Run, Build Application using script" |
| 58 | + # ./location_of_script_within_repo/buildscript.sh |
| 59 | + |
| 60 | + - name: Perform CodeQL Analysis |
| 61 | + uses: github/codeql-action/analyze@v3 |
| 62 | + with: |
| 63 | + category: "/language:${{matrix.language}}" |
| 64 | + |
0 commit comments