name: CodeQL # Advanced setup, replacing CodeQL default setup so the required `Analyze ()` # checks also report for merge queue entries (default setup never runs on merge_group, # which left queued pull requests waiting until the queue timed out). # Languages, query suite and the weekly schedule match the previous default setup. on: pull_request: branches: - main push: branches: - main merge_group: schedule: - cron: '17 3 * * 1' permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: plan: permissions: contents: read actions: read packages: read runs-on: ubuntu-latest timeout-minutes: 10 outputs: full: ${{ steps.plan.outputs.full }} steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4.2.2 with: persist-credentials: false - uses: ./.github/actions/plan-validation id: plan with: workflow: codeql.yml npm-token: ${{ secrets.PERSONAL_TOKEN }} analyze: needs: plan if: needs.plan.outputs.full == 'true' name: Analyze (${{ matrix.language }}) runs-on: ubuntu-latest timeout-minutes: 30 permissions: contents: read security-events: write actions: read strategy: fail-fast: false matrix: language: [actions, javascript-typescript, python] steps: - name: checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4.2.2 with: persist-credentials: false # `Analyze (python)` stays in the matrix because it is a required check, but the # repository may hold no Python at all; CodeQL fails on a language with no source. - name: initialize CodeQL if: matrix.language != 'python' || hashFiles('**/*.py') != '' uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: languages: ${{ matrix.language }} build-mode: none - name: analyze if: matrix.language != 'python' || hashFiles('**/*.py') != '' uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4.38.2 with: category: /language:${{ matrix.language }} upload: ${{ github.event_name != 'merge_group' }}