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