|
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 Advanced" |
| 12 | +name: "CodeQL" |
13 | 13 |
|
14 | 14 | on: |
15 | 15 | push: |
16 | 16 | branches: [ "master" ] |
17 | 17 | pull_request: |
18 | 18 | branches: [ "master" ] |
19 | 19 | schedule: |
20 | | - - cron: '42 8 * * 5' |
| 20 | + - cron: '37 10 * * 6' |
| 21 | + |
| 22 | +# Declare default permissions as read only. |
| 23 | +permissions: read-all |
21 | 24 |
|
22 | 25 | jobs: |
23 | 26 | analyze: |
24 | | - name: Analyze (${{ matrix.language }}) |
| 27 | + name: Analyze |
25 | 28 | # Runner size impacts CodeQL analysis time. To learn more, please see: |
26 | 29 | # - https://gh.io/recommended-hardware-resources-for-running-codeql |
27 | 30 | # - 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. |
| 31 | + # - https://gh.io/using-larger-runners |
| 32 | + # Consider using larger runners for possible analysis time improvements. |
30 | 33 | runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} |
| 34 | + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} |
31 | 35 | 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 |
39 | 36 | actions: read |
40 | 37 | contents: read |
| 38 | + security-events: write |
41 | 39 |
|
42 | 40 | strategy: |
43 | 41 | fail-fast: false |
44 | 42 | matrix: |
45 | | - include: |
46 | | - - language: actions |
47 | | - build-mode: none |
48 | | - - language: java-kotlin |
49 | | - build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too. |
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 |
| 43 | + language: [ 'java-kotlin', 'javascript-typescript' ] |
| 44 | + # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] |
| 45 | + # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both |
| 46 | + # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both |
| 47 | + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support |
| 48 | + |
58 | 49 | steps: |
59 | 50 | - name: Checkout repository |
60 | | - uses: actions/checkout@v4 |
| 51 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 |
61 | 52 |
|
62 | | - # Add any setup steps before running the `github/codeql-action/init` action. |
63 | | - # This includes steps like installing compilers or runtimes (`actions/setup-node` |
64 | | - # or others). This is typically only required for manual builds. |
65 | | - # - name: Setup runtime (example) |
66 | | - # uses: actions/setup-example@v1 |
| 53 | + - uses: gradle/actions/wrapper-validation@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4 |
67 | 54 |
|
68 | 55 | # Initializes the CodeQL tools for scanning. |
69 | 56 | - name: Initialize CodeQL |
70 | | - uses: github/codeql-action/init@v3 |
| 57 | + uses: github/codeql-action/init@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 |
71 | 58 | with: |
72 | 59 | languages: ${{ matrix.language }} |
73 | | - build-mode: ${{ matrix.build-mode }} |
74 | 60 | # If you wish to specify custom queries, you can do so here or in a config file. |
75 | 61 | # By default, queries listed here will override any specified in a config file. |
76 | 62 | # Prefix the list here with "+" to use these queries and those in the config file. |
77 | 63 |
|
78 | 64 | # 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 | 65 | # queries: security-extended,security-and-quality |
80 | 66 |
|
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. |
| 67 | + |
| 68 | + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). |
| 69 | + # If this step fails, then you should remove it and run the build manually (see below) |
| 70 | + - name: Autobuild |
| 71 | + uses: github/codeql-action/autobuild@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 |
| 72 | + |
85 | 73 | # ℹ️ Command-line programs to run using the OS shell. |
86 | 74 | # 📚 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 |
| 75 | + |
| 76 | + # If the Autobuild fails above, remove it and uncomment the following three lines. |
| 77 | + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. |
| 78 | + |
| 79 | + # - run: | |
| 80 | + # echo "Run, Build Application using script" |
| 81 | + # ./location_of_script_within_repo/buildscript.sh |
96 | 82 |
|
97 | 83 | - name: Perform CodeQL Analysis |
98 | | - uses: github/codeql-action/analyze@v3 |
| 84 | + uses: github/codeql-action/analyze@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19 |
99 | 85 | with: |
100 | 86 | category: "/language:${{matrix.language}}" |
0 commit comments