|
| 1 | +name: "CodeQL" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + analyze: |
| 11 | + # Need this because the default runners run out of disk space |
| 12 | + runs-on: [aws-cdk_ubuntu-latest_16-core] |
| 13 | + |
| 14 | + name: Analyze (${{ matrix.language }}) |
| 15 | + # Runner size impacts CodeQL analysis time. To learn more, please see: |
| 16 | + # - https://gh.io/recommended-hardware-resources-for-running-codeql |
| 17 | + # - https://gh.io/supported-runners-and-hardware-resources |
| 18 | + # - https://gh.io/using-larger-runners (GitHub.com only) |
| 19 | + # Consider using larger runners or machines with greater resources for possible analysis time improvements. |
| 20 | + permissions: |
| 21 | + # required for all workflows |
| 22 | + security-events: write |
| 23 | + |
| 24 | + # required to fetch internal or private CodeQL packs |
| 25 | + packages: read |
| 26 | + |
| 27 | + # only required for workflows in private repositories |
| 28 | + actions: read |
| 29 | + contents: read |
| 30 | + |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + include: |
| 35 | + - language: javascript-typescript |
| 36 | + build-mode: none |
| 37 | + - language: python |
| 38 | + build-mode: none |
| 39 | + steps: |
| 40 | + - name: Checkout repository |
| 41 | + uses: actions/checkout@v4 |
| 42 | + |
| 43 | + # Initializes the CodeQL tools for scanning. |
| 44 | + - name: Initialize CodeQL |
| 45 | + uses: github/codeql-action/init@v3 |
| 46 | + with: |
| 47 | + languages: ${{ matrix.language }} |
| 48 | + build-mode: ${{ matrix.build-mode }} |
| 49 | + # If you wish to specify custom queries, you can do so here or in a config file. |
| 50 | + # By default, queries listed here will override any specified in a config file. |
| 51 | + # Prefix the list here with "+" to use these queries and those in the config file. |
| 52 | + |
| 53 | + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs |
| 54 | + # queries: security-extended,security-and-quality |
| 55 | + |
| 56 | + # If the analyze step fails for one of the languages you are analyzing with |
| 57 | + # "We were unable to automatically build your code", modify the matrix above |
| 58 | + # to set the build mode to "manual" for that language. Then modify this step |
| 59 | + # to build your code. |
| 60 | + # ℹ️ Command-line programs to run using the OS shell. |
| 61 | + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
| 62 | + - if: matrix.build-mode == 'manual' |
| 63 | + shell: bash |
| 64 | + run: | |
| 65 | + echo 'If you are using a "manual" build mode for one or more of the' \ |
| 66 | + 'languages you are analyzing, replace this with the commands to build' \ |
| 67 | + 'your code, for example:' |
| 68 | + echo ' make bootstrap' |
| 69 | + echo ' make release' |
| 70 | + exit 1 |
| 71 | +
|
| 72 | + - name: Perform CodeQL Analysis |
| 73 | + uses: github/codeql-action/analyze@v3 |
| 74 | + with: |
| 75 | + category: "/language:${{matrix.language}}" |
0 commit comments