name: CodeQL

on:
  workflow_dispatch:
  # Disable until this is a public repo since advanced security is not enabled
  # push:
  #   branches:
  #     - main
  # pull_request:
  #   branches:
  #     - main
  # schedule:
  #   - cron: '31 7 * * 3'

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

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

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

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

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

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

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