name: CI-codeql

on:
  push:
    branches:
    - 'main'
    - 'release/**'
    - 'dev/**' # Allow running Code QL on dev branches without a PR
  pull_request:
    branches:
    - 'main'
  schedule:
    - cron: '25 23 * * 2'

permissions:
  contents: read

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

    strategy:
      fail-fast: false
      matrix:
        language: [ 'javascript-typescript' ]

    steps:
    - name: Checkout repository
      uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v3.29.5
      with:
        languages: ${{ matrix.language }}
        config: |
          paths: 
          - sources/src

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@b1bff81932f5cdfc8695c7752dcee935dcd061c8 # v3.29.5
