From 8eae75c03a5a2221ea8fbd48e056d2ece4862b14 Mon Sep 17 00:00:00 2001 From: KaifAhmad1 Date: Mon, 30 Mar 2026 20:10:56 +0530 Subject: [PATCH] fix(codeql): disable Default Setup before Advanced Setup analysis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Advanced Setup and Default Setup cannot run simultaneously — SARIF upload fails with "cannot be processed when the default setup is enabled". Added a pre-analysis step that calls the GitHub code-scanning API to switch Default Setup to not-configured before CodeQL runs, eliminating the conflict. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/codeql.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 46cf89a5..58972bab 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -22,6 +22,16 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Disable CodeQL Default Setup + # Advanced Setup (this workflow) and Default Setup cannot run simultaneously. + # This step switches Default Setup to not-configured so SARIF upload succeeds. + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api repos/${{ github.repository }}/code-scanning/default-setup \ + -X PATCH \ + -f state=not-configured || true + - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: