|
11 | 11 | #
|
12 | 12 | name: "CodeQL"
|
13 | 13 |
|
| 14 | +concurrency: |
| 15 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 16 | + cancel-in-progress: true |
| 17 | + |
14 | 18 | on:
|
| 19 | + push: |
| 20 | + branches: [ "main" ] |
| 21 | + paths: |
| 22 | + - "go.mod" |
| 23 | + - "go.sum" |
| 24 | + - "**.go" |
| 25 | + - .github/workflows/codeql.yml |
| 26 | + pull_request: |
| 27 | + branches: [ "main" ] |
| 28 | + paths: |
| 29 | + - "go.mod" |
| 30 | + - "go.sum" |
| 31 | + - "**.go" |
| 32 | + - .github/workflows/codeql.yml |
15 | 33 | schedule:
|
16 |
| - - cron: '21 13 * * 4' |
| 34 | + - cron: '32 4 * * 1' |
17 | 35 |
|
18 | 36 | jobs:
|
19 | 37 | analyze:
|
20 | 38 | name: Analyze
|
21 |
| - runs-on: ubuntu-latest |
| 39 | + runs-on: ubuntu-latest-16-cores |
| 40 | + permissions: |
| 41 | + actions: read |
| 42 | + contents: read |
| 43 | + security-events: write |
22 | 44 |
|
23 | 45 | strategy:
|
24 | 46 | fail-fast: false
|
25 | 47 | matrix:
|
26 | 48 | language: [ 'go' ]
|
27 |
| - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] |
28 |
| - # Learn more: |
29 |
| - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed |
| 49 | + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] |
| 50 | + # Use only 'java' to analyze code written in Java, Kotlin or both |
| 51 | + # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both |
| 52 | + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support |
30 | 53 |
|
31 | 54 | steps:
|
32 | 55 | - name: Checkout repository
|
33 |
| - uses: actions/checkout@v3 |
| 56 | + uses: actions/checkout@v4 |
34 | 57 |
|
35 | 58 | # Initializes the CodeQL tools for scanning.
|
36 | 59 | - name: Initialize CodeQL
|
37 |
| - uses: github/codeql-action/init@v1 |
| 60 | + uses: github/codeql-action/init@v3 |
38 | 61 | with:
|
39 | 62 | languages: ${{ matrix.language }}
|
40 | 63 | # If you wish to specify custom queries, you can do so here or in a config file.
|
41 | 64 | # By default, queries listed here will override any specified in a config file.
|
42 | 65 | # Prefix the list here with "+" to use these queries and those in the config file.
|
43 |
| - # queries: ./path/to/local/query, your-org/your-repo/queries@main |
44 |
| - queries: security-and-quality |
45 | 66 |
|
46 |
| - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). |
| 67 | + # 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 |
| 68 | + # queries: security-extended,security-and-quality |
| 69 | + |
| 70 | + |
| 71 | + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). |
47 | 72 | # If this step fails, then you should remove it and run the build manually (see below)
|
48 | 73 | - name: Autobuild
|
49 |
| - uses: github/codeql-action/autobuild@v1 |
| 74 | + uses: github/codeql-action/autobuild@v3 |
50 | 75 |
|
51 | 76 | # ℹ️ Command-line programs to run using the OS shell.
|
52 |
| - # 📚 https://git.io/JvXDl |
| 77 | + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun |
53 | 78 |
|
54 |
| - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines |
55 |
| - # and modify them (or add more) to build your code if your project |
56 |
| - # uses a compiled language |
| 79 | + # If the Autobuild fails above, remove it and uncomment the following three lines. |
| 80 | + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. |
57 | 81 |
|
58 |
| - #- run: | |
59 |
| - # make bootstrap |
60 |
| - # make release |
| 82 | + # - run: | |
| 83 | + # echo "Run, Build Application using script" |
| 84 | + # ./location_of_script_within_repo/buildscript.sh |
61 | 85 |
|
62 | 86 | - name: Perform CodeQL Analysis
|
63 |
| - uses: github/codeql-action/analyze@v1 |
64 |
| - |
65 |
| - - name: Print SARIF file contents after analysis |
66 |
| - run: | |
67 |
| - for f in $(ls "/home/runner/work/deploy/results"); do |
68 |
| - echo -e "\\n/home/runner/work/deploy/results/$f:"; |
69 |
| - # cat "/home/runner/work/deploy/results/$f"; |
70 |
| - done |
| 87 | + uses: github/codeql-action/analyze@v3 |
| 88 | + with: |
| 89 | + category: "/language:${{matrix.language}}" |
0 commit comments