# # Copyright 2021 The Sigstore Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. name: CodeQL on: push: branches: - main pull_request: # The branches below must be a subset of the branches above branches: - main permissions: {} jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: contents: read security-events: write strategy: fail-fast: false matrix: language: - "go" steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Get Go version directive from go.mod as major.minor id: go_version run: | awk -F'[ .]' '/^go /{print "version=" $2 "." $3; exit}' go.mod >>"${GITHUB_OUTPUT}" - name: Set up Go uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 with: go-version: "${{ steps.go_version.outputs.version }}" check-latest: true # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@99c9897648dded3fe63d6f328c46089dd57735ca # v2.17.0 with: languages: ${{ matrix.language }} build-mode: manual - name: build run: make pkg - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@99c9897648dded3fe63d6f328c46089dd57735ca # v2.17.0 with: category: "/language:${{ matrix.language }}"