name: CodeQL on: push: branches: - main - "release/**" paths: - "**.go" - "**/go.mod" - "**/go.sum" - "**.py" - "**requirements.txt" - ".github/workflows/codeql.yml" jobs: codeql: name: CodeQL runs-on: ubuntu-22.04 permissions: actions: read contents: read security-events: write strategy: fail-fast: false matrix: language: ["go", "python"] steps: - name: Checkout repository uses: actions/checkout@24cb9080177205b6e8c946b17badbe402adc938f # v3.4.0 - name: Setup Go environment if: matrix.language == 'go' uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 with: go-version: "1.20.2" - name: Initialize CodeQL uses: github/codeql-action/init@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7 with: languages: ${{ matrix.language }} - name: Install Go Dependencies if: matrix.language == 'go' run: | echo "::group::Install apt dependencies" sudo apt-get update && sudo apt-get install -y libcryptsetup12 libcryptsetup-dev libvirt-dev echo "::endgroup::" echo "::group::Install go dependencies" mods=$(go list -f '{{.Dir}}' -m | xargs) for mod in $mods; do go mod download -C "$mod" done echo "::endgroup::" - name: Autobuild uses: github/codeql-action/autobuild@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7 - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@168b99b3c22180941ae7dbdd5f5c9678ede476ba # v2.2.7 with: category: "/language:${{ matrix.language }}"