name: 'CodeQL'

on:
  push:
    branches: ['master']
  pull_request:
    branches: ['master']

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

jobs:
  analyze:
    name: Analyze
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - language: javascript
            os: ubuntu-24.04
          - language: ruby
            os: ubuntu-24.04-16core

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

      - name: Initialize CodeQL
        uses: github/codeql-action/init@v3
        with:
          languages: ${{ matrix.language }}
          config-file: ./.github/codeql/${{ matrix.language }}/codeql-config.yml

      - name: Perform CodeQL Analysis
        uses: github/codeql-action/analyze@v3
        with:
          category: codeql/${{ matrix.language }}/full
