From 748c5208cd1ec0a925fc7bcf9d945001db36652a Mon Sep 17 00:00:00 2001 From: NullSablex <244216261+NullSablex@users.noreply.github.com> Date: Sun, 30 Aug 2026 13:42:36 -0300 Subject: [PATCH] ci: migrate CodeQL from default to advanced setup The default setup only analysed a pull request when it touched files relevant to the configured languages. A PR changing only docs or a dependency manifest produced no analysis, while master still carried one per language, so the code_scanning branch rule could not diff the two sides and reported 'configurations not found'. Add a codeql.yml with no path filter so both configurations exist on every PR, keeping the /language:actions and /language:rust categories recorded on master. --- .github/workflows/codeql.yml | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..294fb67 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,55 @@ +# CodeQL advanced setup. +# +# Replaces the repository's CodeQL *default* setup, which only analyses a pull +# request when it touches files relevant to the configured languages. A PR that +# changes only docs or dependency manifests produced no analysis at all, while +# `master` still carried one per language — so the `code_scanning` branch rule +# could not diff the two sides and reported "configurations not found". +# +# Running here, with no path filter, guarantees both configurations exist on +# every pull request. The categories below must keep matching the ones recorded +# on `master` (`/language:actions`, `/language:rust`) for that diff to work. +name: CodeQL + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + schedule: + # Weekly, to catch newly published queries against unchanged code. + - cron: '27 4 * * 1' + workflow_dispatch: + +permissions: + contents: read + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + permissions: + contents: read + security-events: write # upload the SARIF results + actions: read + strategy: + fail-fast: false + matrix: + # Keep in sync with the languages the previous default setup covered. + language: [ actions, rust ] + + steps: + - uses: actions/checkout@v7 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v4 + with: + languages: ${{ matrix.language }} + # Neither language needs a compiled build for CodeQL to extract it. + build-mode: none + queries: security-extended + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v4 + with: + category: "/language:${{ matrix.language }}"