CodeQL Advanced #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CodeQL Advanced" | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
- cron: '40 2 * * 6' | |
jobs: | |
analyze: | |
name: Analyze (${{ matrix.language }}) | |
runs-on: ubuntu-latest | |
permissions: | |
security-events: write | |
packages: read | |
actions: read | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ['go'] | |
build-mode: ['manual'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Cache Go modules | |
uses: actions/cache@v4.0.2 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: go-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
go-mod-${{ runner.os }}- | |
continue-on-error: true | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
build-mode: ${{ matrix.build-mode }} | |
- name: Build Go project | |
run: | | |
go build ./... | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/language:${{matrix.language}}" |