name: "CodeQL"

permissions:
  contents: read

on:
  push:
    branches:
    - "main"
  pull_request:
    branches:
    - "main"
  schedule:
  - cron: '16 11 * * 5'

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-22.04
    timeout-minutes: 360
    permissions:
      actions: read
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language:
        - go

    steps:
    - name: Checkout repository
      uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29  # v4.1.6

    - name: Initialize CodeQL
      uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93  # v3.26.6
      with:
        languages: ${{ matrix.language }}

    - name: Autobuild
      uses: github/codeql-action/autobuild@4dd16135b69a43b6c8efb853346f8437d92d3c93  # v3.26.6

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93  # v3.26.6
      with:
        category: "/language:${{matrix.language}}"
