name: "CodeQL"

on:
  workflow_dispatch:
  push:
    branches: ["preview", "canary", "master"]
  pull_request:
    branches: ["preview", "canary", "master"]

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

    env:
      CODEQL_ACTION_FILE_COVERAGE_ON_PRS: "false"

    strategy:
      fail-fast: false
      matrix:
        language: ["python", "javascript"]

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

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

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

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v4
        with:
          category: "/language:${{matrix.language}}"
