mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
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>
48 lines
1.1 KiB
YAML
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"
|