Files
semantica/.github/workflows/codeql.yml
T
KaifAhmad1andClaude Sonnet 4.6 8eae75c03a fix(codeql): disable Default Setup before Advanced Setup analysis
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 <noreply@anthropic.com>
2026-03-30 20:10:56 +05:30

48 lines
1.1 KiB
YAML

name: CodeQL
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '30 1 * * 1' # Every Monday 7 AM IST
permissions:
contents: read
security-events: write
actions: read
jobs:
analyze:
name: Analyze Python
runs-on: ubuntu-latest
steps:
- 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:
languages: python
queries: security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:python"