name: CodeQL
on:
  push:
    branches:
      - master
    paths-ignore:
      - "docs/**"
  pull_request:
    branches:
      - master
    paths-ignore:
      - "docs/**"
  schedule:
    - cron: "21 14 * * 2"

jobs:
  analyze:
    name: Analyze (javascript-typescript)
    runs-on: ubuntu-latest
    permissions:
      security-events: write
      packages: read

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

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

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v3
        with:
          category: "/language:javascript-typescript"
