|
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: "Advanced CodeQL" |
13 | 13 |
|
14 | 14 | on: |
15 | 15 | push: |
|
21 | 21 |
|
22 | 22 | jobs: |
23 | 23 | analyze: |
24 | | - name: Analyze |
| 24 | + name: Analyze (${{ matrix.language }}) |
25 | 25 | # Runner size impacts CodeQL analysis time. To learn more, please see: |
26 | 26 | # - https://gh.io/recommended-hardware-resources-for-running-codeql |
27 | 27 | # - https://gh.io/supported-runners-and-hardware-resources |
28 | | - # - https://gh.io/using-larger-runners |
29 | | - # Consider using larger runners for possible analysis time improvements. |
| 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 | 30 | runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} |
31 | | - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} |
32 | 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 |
33 | 39 | actions: read |
34 | 40 | contents: read |
35 | | - security-events: write |
36 | 41 |
|
37 | 42 | strategy: |
38 | 43 | fail-fast: false |
39 | 44 | matrix: |
40 | | - language: [ 'csharp' ] |
41 | | - # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] |
42 | | - # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both |
43 | | - # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both |
44 | | - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support |
| 45 | + include: |
| 46 | + - language: actions |
| 47 | + build-mode: none |
| 48 | + - language: csharp |
| 49 | + build-mode: manual |
| 50 | + # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', '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 |
45 | 58 |
|
46 | 59 | steps: |
47 | 60 | - name: Checkout repository |
48 | | - uses: actions/checkout@v6 |
| 61 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 62 | + |
| 63 | + # Add any setup steps before running the `github/codeql-action/init` action. |
| 64 | + # This includes steps like installing compilers or runtimes (`actions/setup-node` |
| 65 | + # or others). This is typically only required for manual builds. |
| 66 | + # - name: Setup runtime (example) |
| 67 | + # uses: actions/setup-example@v1 |
| 68 | + |
| 69 | + - name: Setup .NET Core |
| 70 | + if: ${{ matrix.language == 'csharp' }} |
| 71 | + uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # V5.2.0 |
| 72 | + with: |
| 73 | + global-json-file: global.json |
49 | 74 |
|
50 | 75 | # Initializes the CodeQL tools for scanning. |
51 | 76 | - name: Initialize CodeQL |
52 | | - uses: github/codeql-action/init@v4 |
| 77 | + uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 |
53 | 78 | with: |
54 | 79 | languages: ${{ matrix.language }} |
| 80 | + build-mode: ${{ matrix.build-mode }} |
55 | 81 | # If you wish to specify custom queries, you can do so here or in a config file. |
56 | 82 | # By default, queries listed here will override any specified in a config file. |
57 | 83 | # Prefix the list here with "+" to use these queries and those in the config file. |
58 | | - |
| 84 | + |
59 | 85 | # 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 |
60 | 86 | # queries: security-extended,security-and-quality |
61 | | - |
62 | | - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). |
63 | | - # If this step fails, then you should remove it and run the build manually (see below) |
64 | | - # - name: Autobuild |
65 | | - # uses: github/codeql-action/autobuild@v3 |
66 | | - |
67 | | - - name: Setup .NET Core |
68 | | - uses: actions/setup-dotnet@v5 |
69 | | - with: |
70 | | - global-json-file: global.json |
71 | | - |
72 | | - - name: Restore nHapi |
| 87 | + |
| 88 | + # If the analyze step fails for one of the languages you are analyzing with |
| 89 | + # "We were unable to automatically build your code", modify the matrix above |
| 90 | + # to set the build mode to "manual" for that language. Then modify this step |
| 91 | + # to build your code. |
| 92 | + # ℹ️ Command-line programs to run using the OS shell. |
| 93 | + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
| 94 | + - name: Run manual build steps |
| 95 | + if: ${{ matrix.language == 'csharp' }} |
| 96 | + shell: bash |
73 | 97 | run: | |
74 | 98 | dotnet restore nHapi.sln --configfile build/.nuget/NuGet.config |
75 | | -
|
76 | | - - name: Build nHapi |
77 | | - run: | |
78 | 99 | dotnet build nHapi.sln -c Release --no-restore |
79 | 100 |
|
80 | | - # ℹ️ Command-line programs to run using the OS shell. |
81 | | - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
82 | | - |
83 | | - # If the Autobuild fails above, remove it and uncomment the following three lines. |
84 | | - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. |
85 | | - |
86 | | - # - run: | |
87 | | - # echo "Run, Build Application using script" |
88 | | - # ./location_of_script_within_repo/buildscript.sh |
89 | | - |
90 | 101 | - name: Perform CodeQL Analysis |
91 | | - uses: github/codeql-action/analyze@v4 |
| 102 | + uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4.32.6 |
92 | 103 | with: |
93 | 104 | category: "/language:${{matrix.language}}" |
0 commit comments