name: "CodeQL"

on:
  push:
    branches:
      - master
      - "!dependabot/**"
  pull_request:
    branches:
      - master
      - "!dependabot/**"
  schedule:
    - cron: "40 15 * * 4"
  workflow_dispatch:

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

    steps:
      - name: Clone repository
        uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
        with:
          persist-credentials: false

      - name: Initialize CodeQL
        uses: github/codeql-action/init@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5
        with:
          languages: "python"
          queries: +security-and-quality

      - name: Autobuild
        uses: github/codeql-action/autobuild@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5
        with:
          category: "/language:python"
