name: "codeql"

on:
  schedule:
    - cron: '0 4 * * 1'
  workflow_dispatch:
  push:
    branches:
    - 'main'
  pull_request:

defaults:
  run:
    shell: bash

permissions:
  contents: read
  security-events: write

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

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

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

    - name: Initialize CodeQL
      uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa
      with:
        languages: ${{ matrix.language }}
        queries: security-extended

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa
