|
| 1 | +name: "CodeQL Advanced" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + analyze: |
| 11 | + name: Analyze (${{ matrix.language }}) |
| 12 | + # Runner size impacts CodeQL analysis time. To learn more, please see: |
| 13 | + # - https://gh.io/recommended-hardware-resources-for-running-codeql |
| 14 | + # - https://gh.io/supported-runners-and-hardware-resources |
| 15 | + # - https://gh.io/using-larger-runners (GitHub.com only) |
| 16 | + # Consider using larger runners or machines with greater resources for possible analysis time improvements. |
| 17 | + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} |
| 18 | + permissions: |
| 19 | + # required for all workflows |
| 20 | + security-events: write |
| 21 | + |
| 22 | + # required to fetch internal or private CodeQL packs |
| 23 | + packages: read |
| 24 | + |
| 25 | + # only required for workflows in private repositories |
| 26 | + actions: read |
| 27 | + contents: read |
| 28 | + |
| 29 | + strategy: |
| 30 | + fail-fast: false |
| 31 | + matrix: |
| 32 | + include: |
| 33 | + - language: actions |
| 34 | + build-mode: none |
| 35 | + - language: go |
| 36 | + build-mode: manual |
| 37 | + - language: python |
| 38 | + build-mode: none |
| 39 | + |
| 40 | + steps: |
| 41 | + - name: Checkout repository |
| 42 | + uses: actions/checkout@v4 |
| 43 | + |
| 44 | + # Initializes the CodeQL tools for scanning. |
| 45 | + - name: Initialize CodeQL |
| 46 | + uses: github/codeql-action/init@v3 |
| 47 | + with: |
| 48 | + languages: ${{ matrix.language }} |
| 49 | + build-mode: ${{ matrix.build-mode }} |
| 50 | + |
| 51 | + # If the analyze step fails for one of the languages you are analyzing with |
| 52 | + # "We were unable to automatically build your code", modify the matrix above |
| 53 | + # to set the build mode to "manual" for that language. Then modify this step |
| 54 | + # to build your code. |
| 55 | + # ℹ️ Command-line programs to run using the OS shell. |
| 56 | + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
| 57 | + - if: matrix.build-mode == 'manual' |
| 58 | + shell: bash |
| 59 | + run: | |
| 60 | + go mod download |
| 61 | + make build |
| 62 | +
|
| 63 | + - name: Perform CodeQL Analysis |
| 64 | + uses: github/codeql-action/analyze@v3 |
| 65 | + with: |
| 66 | + category: "/language:${{matrix.language}}" |
0 commit comments