|
10 | 10 | # supported CodeQL languages.
|
11 | 11 | #
|
12 | 12 | name: "CodeQL"
|
| 13 | + |
13 | 14 | on:
|
14 | 15 | push:
|
15 |
| - branches: [ "main" ] |
| 16 | + branches: ["main"] |
16 | 17 | pull_request:
|
17 |
| - branches: [ "main" ] |
| 18 | + # The branches below must be a subset of the branches above |
| 19 | + branches: ["main"] |
18 | 20 | schedule:
|
19 |
| - - cron: '33 12 * * 2' |
| 21 | + - cron: "0 0 * * 1" |
| 22 | + |
20 | 23 | permissions:
|
21 | 24 | contents: read
|
22 | 25 |
|
23 | 26 | jobs:
|
24 | 27 | analyze:
|
25 |
| - name: Analyze (${{ matrix.language }}) |
26 |
| - # Runner size impacts CodeQL analysis time. To learn more, please see: |
27 |
| - # - https://gh.io/recommended-hardware-resources-for-running-codeql |
28 |
| - # - https://gh.io/supported-runners-and-hardware-resources |
29 |
| - # - https://gh.io/using-larger-runners (GitHub.com only) |
30 |
| - # Consider using larger runners or machines with greater resources for possible analysis time improvements. |
31 |
| - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} |
32 |
| - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} |
| 28 | + name: Analyze |
| 29 | + runs-on: ubuntu-latest |
33 | 30 | permissions:
|
34 |
| - # required for all workflows |
35 |
| - security-events: write |
36 |
| - |
37 |
| - # required to fetch internal or private CodeQL packs |
38 |
| - packages: read |
39 |
| - |
40 |
| - # only required for workflows in private repositories |
41 | 31 | actions: read
|
42 | 32 | contents: read
|
| 33 | + security-events: write |
43 | 34 |
|
44 | 35 | strategy:
|
45 | 36 | fail-fast: false
|
46 | 37 | matrix:
|
47 |
| - include: |
48 |
| - - language: javascript-typescript |
49 |
| - build-mode: none |
50 |
| - # CodeQL supports the following values keywords for 'language': '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 |
| 38 | + language: ["javascript", "typescript"] |
| 39 | + # CodeQL supports [ $supported-codeql-languages ] |
| 40 | + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support |
| 41 | + |
58 | 42 | steps:
|
59 |
| - - name: Checkout repository |
60 |
| - uses: actions/checkout@v4 |
| 43 | + - name: Harden Runner |
| 44 | + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 |
| 45 | + with: |
| 46 | + egress-policy: audit |
| 47 | + |
| 48 | + - name: Checkout repository |
| 49 | + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 |
| 50 | + |
| 51 | + # Initializes the CodeQL tools for scanning. |
| 52 | + - name: Initialize CodeQL |
| 53 | + uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12 |
| 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. |
| 59 | + |
| 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@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12 |
| 64 | + |
| 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 |
61 | 67 |
|
62 |
| - # Initializes the CodeQL tools for scanning. |
63 |
| - - name: Initialize CodeQL |
64 |
| - uses: github/codeql-action/init@v3 |
65 |
| - with: |
66 |
| - languages: ${{ matrix.language }} |
67 |
| - build-mode: ${{ matrix.build-mode }} |
68 |
| - # If you wish to specify custom queries, you can do so here or in a config file. |
69 |
| - # By default, queries listed here will override any specified in a config file. |
70 |
| - # Prefix the list here with "+" to use these queries and those in the config file. |
| 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. |
71 | 70 |
|
72 |
| - # 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 |
73 |
| - # queries: security-extended,security-and-quality |
74 |
| - config: | |
75 |
| - paths-ignore: |
76 |
| - - dist/** |
77 |
| - # If the analyze step fails for one of the languages you are analyzing with |
78 |
| - # "We were unable to automatically build your code", modify the matrix above |
79 |
| - # to set the build mode to "manual" for that language. Then modify this step |
80 |
| - # to build your code. |
81 |
| - # ℹ️ Command-line programs to run using the OS shell. |
82 |
| - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
83 |
| - - if: matrix.build-mode == 'manual' |
84 |
| - run: | |
85 |
| - echo 'If you are using a "manual" build mode for one or more of the' \ |
86 |
| - 'languages you are analyzing, replace this with the commands to build' \ |
87 |
| - 'your code, for example:' |
88 |
| - echo ' make bootstrap' |
89 |
| - echo ' make release' |
90 |
| - exit 1 |
| 71 | + # - run: | |
| 72 | + # echo "Run, Build Application using script" |
| 73 | + # ./location_of_script_within_repo/buildscript.sh |
91 | 74 |
|
92 |
| - - name: Perform CodeQL Analysis |
93 |
| - uses: github/codeql-action/analyze@v3 |
94 |
| - with: |
95 |
| - category: "/language:${{matrix.language}}" |
| 75 | + - name: Perform CodeQL Analysis |
| 76 | + uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12 |
| 77 | + with: |
| 78 | + category: "/language:${{matrix.language}}" |
0 commit comments