name: "CodeQL"

on:
  push:
    branches: [ master, release-* ]

permissions:
  contents: read

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-22.04

    permissions:
      actions: read  # for github/codeql-action/init to get workflow details
      security-events: write  # for github/codeql-action/autobuild to send a status report

    strategy:
      fail-fast: false
      matrix:
        language: [ 'go' ]

    steps:
      - name: Checkout repository
        uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9

      - name: Initialize CodeQL
        uses: github/codeql-action/init@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
        with:
          languages: ${{ matrix.language }}

      - name: Autobuild
        uses: github/codeql-action/autobuild@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@959cbb7472c4d4ad70cdfe6f4976053fe48ab394 # v2.1.37
