name: CodeQL # Run code security scans

on:
  pull_request:
    branches:
      - main
      - main_v1

  push:
    branches:
      - main
      - main_v1

  merge_group:
    types: [checks_requested]

  schedule:
    - cron: '0 0 * * 0'

jobs:
  CodeQL:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2 # https://github.com/actions/checkout

      - name: Initialize
        uses: github/codeql-action/init@v2
        with:
          languages: javascript

      - name: Analyze
        uses: github/codeql-action/analyze@v2