name: "CodeQL"

on:
  push:
    branches: [ main, stable, oldstable, middleware ]
  pull_request:
    branches: [ main, stable, oldstable, middleware ]
  schedule:
    - cron: '30 5 * * 0' # 5:30h on Sundays

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
      security-events: write

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

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

    - name: Initialize CodeQL
      uses: github/codeql-action/init@v4
      with:
        languages: ${{ matrix.language }}

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