|  | 
| 9 | 9 | # the `language` matrix defined below to confirm you have the correct set of | 
| 10 | 10 | # supported CodeQL languages. | 
| 11 | 11 | # | 
| 12 |  | -name: "CodeQL" | 
|  | 12 | +name: "CodeQL Advanced" | 
| 13 | 13 | 
 | 
| 14 | 14 | on: | 
| 15 | 15 |   push: | 
| 16 | 16 |     branches: ["main"] | 
| 17 | 17 |   pull_request: | 
| 18 |  | -    # The branches below must be a subset of the branches above | 
| 19 | 18 |     branches: ["main"] | 
| 20 | 19 |   schedule: | 
| 21 |  | -    - cron: "0 0 * * 1" | 
| 22 |  | - | 
| 23 |  | -permissions: | 
| 24 |  | -  contents: read | 
|  | 20 | +    - cron: "19 3 * * 1" | 
| 25 | 21 | 
 | 
| 26 | 22 | jobs: | 
| 27 | 23 |   analyze: | 
| 28 |  | -    name: Analyze | 
| 29 |  | -    runs-on: ubuntu-latest | 
|  | 24 | +    name: Analyze (${{ matrix.language }}) | 
|  | 25 | +    # Runner size impacts CodeQL analysis time. To learn more, please see: | 
|  | 26 | +    #   - https://gh.io/recommended-hardware-resources-for-running-codeql | 
|  | 27 | +    #   - https://gh.io/supported-runners-and-hardware-resources | 
|  | 28 | +    #   - https://gh.io/using-larger-runners (GitHub.com only) | 
|  | 29 | +    # Consider using larger runners or machines with greater resources for possible analysis time improvements. | 
|  | 30 | +    runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} | 
| 30 | 31 |     permissions: | 
|  | 32 | +      # required for all workflows | 
|  | 33 | +      security-events: write | 
|  | 34 | + | 
|  | 35 | +      # required to fetch internal or private CodeQL packs | 
|  | 36 | +      packages: read | 
|  | 37 | + | 
|  | 38 | +      # only required for workflows in private repositories | 
| 31 | 39 |       actions: read | 
| 32 | 40 |       contents: read | 
| 33 |  | -      security-events: write | 
| 34 | 41 | 
 | 
| 35 | 42 |     strategy: | 
| 36 | 43 |       fail-fast: false | 
| 37 | 44 |       matrix: | 
| 38 |  | -        language: ["go"] | 
| 39 |  | -        # CodeQL supports [ $supported-codeql-languages ] | 
| 40 |  | -        # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | 
| 41 |  | - | 
|  | 45 | +        include: | 
|  | 46 | +          - language: actions | 
|  | 47 | +            build-mode: none | 
|  | 48 | +          - language: go | 
|  | 49 | +            build-mode: autobuild | 
|  | 50 | +        # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' | 
|  | 51 | +        # Use `c-cpp` to analyze code written in C, C++ or both | 
|  | 52 | +        # Use 'java-kotlin' to analyze code written in Java, Kotlin or both | 
|  | 53 | +        # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both | 
|  | 54 | +        # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, | 
|  | 55 | +        # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. | 
|  | 56 | +        # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how | 
|  | 57 | +        # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages | 
| 42 | 58 |     steps: | 
| 43 | 59 |       - name: Harden Runner | 
| 44 |  | -        uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | 
|  | 60 | +        uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | 
| 45 | 61 |         with: | 
| 46 | 62 |           egress-policy: audit | 
| 47 | 63 | 
 | 
| 48 | 64 |       - name: Checkout repository | 
| 49 | 65 |         uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | 
| 50 | 66 | 
 | 
| 51 |  | -      - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | 
|  | 67 | +      # Add any setup steps before running the `github/codeql-action/init` action. | 
|  | 68 | +      # This includes steps like installing compilers or runtimes (`actions/setup-node` | 
|  | 69 | +      # or others). This is typically only required for manual builds. | 
|  | 70 | +      # - name: Setup runtime (example) | 
|  | 71 | +      #   uses: actions/setup-example@v1 | 
|  | 72 | +      - if: matrix.language == 'go' | 
|  | 73 | +        uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 | 
| 52 | 74 |         with: | 
| 53 |  | -          go-version: "1.21.4" | 
|  | 75 | +          go-version-file: test/go.mod | 
| 54 | 76 | 
 | 
| 55 | 77 |       # Initializes the CodeQL tools for scanning. | 
| 56 | 78 |       - name: Initialize CodeQL | 
| 57 |  | -        uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 | 
|  | 79 | +        uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16 | 
| 58 | 80 |         with: | 
| 59 | 81 |           languages: ${{ matrix.language }} | 
|  | 82 | +          build-mode: ${{ matrix.build-mode }} | 
| 60 | 83 |           # If you wish to specify custom queries, you can do so here or in a config file. | 
| 61 | 84 |           # By default, queries listed here will override any specified in a config file. | 
| 62 | 85 |           # Prefix the list here with "+" to use these queries and those in the config file. | 
| 63 | 86 | 
 | 
| 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@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 | 
|  | 87 | +          # 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 | 
|  | 88 | +          # queries: security-extended,security-and-quality | 
| 68 | 89 | 
 | 
|  | 90 | +      # If the analyze step fails for one of the languages you are analyzing with | 
|  | 91 | +      # "We were unable to automatically build your code", modify the matrix above | 
|  | 92 | +      # to set the build mode to "manual" for that language. Then modify this step | 
|  | 93 | +      # to build your code. | 
| 69 | 94 |       # ℹ️ Command-line programs to run using the OS shell. | 
| 70 | 95 |       # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | 
| 71 |  | - | 
| 72 |  | -      #   If the Autobuild fails above, remove it and uncomment the following three lines. | 
| 73 |  | -      #   modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | 
| 74 |  | - | 
| 75 |  | -      # - run: | | 
| 76 |  | -      #   echo "Run, Build Application using script" | 
| 77 |  | -      #   ./location_of_script_within_repo/buildscript.sh | 
|  | 96 | +      - if: matrix.build-mode == 'manual' | 
|  | 97 | +        shell: bash | 
|  | 98 | +        run: | | 
|  | 99 | +          echo 'If you are using a "manual" build mode for one or more of the' \ | 
|  | 100 | +            'languages you are analyzing, replace this with the commands to build' \ | 
|  | 101 | +            'your code, for example:' | 
|  | 102 | +          echo '  make bootstrap' | 
|  | 103 | +          echo '  make release' | 
|  | 104 | +          exit 1 | 
| 78 | 105 | 
 | 
| 79 | 106 |       - name: Perform CodeQL Analysis | 
| 80 |  | -        uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 | 
|  | 107 | +        uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16 | 
| 81 | 108 |         with: | 
| 82 | 109 |           category: "/language:${{matrix.language}}" | 
0 commit comments