name: CodeQL

on:
  pull_request:
    branches:
      - main
  push:
    branches:
      - main
  schedule:
    - cron: '31 7 * * 3'

permissions: {}

jobs:
  analyze:
    name: Analyze
    runs-on: ubuntu-latest

    permissions:
      actions: read
      checks: write
      contents: read
      security-events: write

    strategy:
      fail-fast: false
      matrix:
        language:
          - TypeScript

    steps:
      - name: Checkout
        id: checkout
        uses: actions/checkout@v6.0.2

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

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

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