name: "Code scanning - action"

on:
  push:
  pull_request:
  schedule:
    - cron: '30 1 * * 6'

jobs:
  CodeQL-Build:
    runs-on: ubuntu-latest

    permissions:
      security-events: write

    steps:
    - name: Checkout repository
      uses: actions/checkout@v4
      with:
        fetch-depth: 0

    - name: Set up Go
      uses: actions/setup-go@v5
      with:
        go-version: '1.22'

    - name: Initialize CodeQL
      uses: github/codeql-action/init@v3
      with:
        languages: go

    - name: Autobuild
      uses: github/codeql-action/autobuild@v3

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v3