|
| 1 | +# For most projects, this workflow file will not need changing; you simply need |
| 2 | +# to commit it to your repository. |
| 3 | +# |
| 4 | +# You may wish to alter this file to override the set of languages analyzed, |
| 5 | +# or to provide custom queries or build logic. |
| 6 | +# |
| 7 | +# ******** NOTE ******** |
| 8 | +# We have attempted to detect the languages in your repository. Please check |
| 9 | +# the `language` matrix defined below to confirm you have the correct set of |
| 10 | +# supported CodeQL languages. |
| 11 | +# |
| 12 | +name: "CodeQL" |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + |
| 17 | +on: |
| 18 | + push: |
| 19 | + branches: [ main ] |
| 20 | + paths-ignore: |
| 21 | + - '**/*.md' |
| 22 | + - '**/*.txt' |
| 23 | + - '**/*.yaml' |
| 24 | + pull_request: |
| 25 | + # The branches below must be a subset of the branches above |
| 26 | + branches: [ main ] |
| 27 | + paths-ignore: |
| 28 | + - '**/*.md' |
| 29 | + - '**/*.txt' |
| 30 | + - '**/*.yaml' |
| 31 | + schedule: |
| 32 | + - cron: '30 20 * * 2' |
| 33 | + |
| 34 | +jobs: |
| 35 | + analyze: |
| 36 | + name: Analyze |
| 37 | + runs-on: ubuntu-latest |
| 38 | + permissions: |
| 39 | + actions: read |
| 40 | + contents: read |
| 41 | + security-events: write |
| 42 | + |
| 43 | + strategy: |
| 44 | + fail-fast: false |
| 45 | + matrix: |
| 46 | + language: [ 'go' ] |
| 47 | + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] |
| 48 | + # Learn more about CodeQL language support at https://git.io/codeql-language-support |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Harden Runner |
| 52 | + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 |
| 53 | + with: |
| 54 | + egress-policy: audit |
| 55 | + |
| 56 | + - name: Checkout repository |
| 57 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 58 | + - name: Setup go |
| 59 | + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 |
| 60 | + with: |
| 61 | + go-version: '1.22.x' |
| 62 | + |
| 63 | + # Initializes the CodeQL tools for scanning. |
| 64 | + - name: Initialize CodeQL |
| 65 | + uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 |
| 66 | + with: |
| 67 | + languages: ${{ matrix.language }} |
| 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. |
| 71 | + # queries: ./path/to/local/query, your-org/your-repo/queries@main |
| 72 | + |
| 73 | + - uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 |
| 74 | + with: |
| 75 | + path: | |
| 76 | + ~/.cache/go-build |
| 77 | + ~/.cache/pip |
| 78 | + ~/go/pkg/mod |
| 79 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 80 | + restore-keys: | |
| 81 | + ${{ runner.os }}-go- |
| 82 | +
|
| 83 | + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). |
| 84 | + # If this step fails, then you should remove it and run the build manually (see below) |
| 85 | + # - name: Autobuild |
| 86 | + # uses: github/codeql-action/autobuild@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9 |
| 87 | + |
| 88 | + # ℹ️ Command-line programs to run using the OS shell. |
| 89 | + # 📚 https://git.io/JvXDl |
| 90 | + |
| 91 | + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines |
| 92 | + # and modify them (or add more) to build your code if your project |
| 93 | + # uses a compiled language |
| 94 | + |
| 95 | + - run: | |
| 96 | + make -j 4 all |
| 97 | +
|
| 98 | + - name: Perform CodeQL Analysis |
| 99 | + uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8 |
0 commit comments