name: "Code Scanning - CodeQL"

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    - cron: '21 17 * * 0'

jobs:
  codeql:
    runs-on: ubuntu-latest

    permissions:
      contents: read
      security-events: write
      pull-requests: read

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

      - name: Initialize CodeQL
        uses: github/codeql-action/init@main
        with:
            languages: javascript
            config-file: ./.github/codeql/codeql-config.yml
            tools: latest

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