From 1596906e3f6318c702b9ed23564bcc47454959de Mon Sep 17 00:00:00 2001 From: abhizipstack Date: Mon, 6 Apr 2026 13:25:38 +0530 Subject: [PATCH 1/2] feat: add CodeQL security analysis workflow Adds automated security scanning for Python and JavaScript: - Runs on PRs to main and pushes to main - Weekly scheduled scan (Monday 6am UTC) - Results visible in GitHub Security tab + PR checks - Complements SonarCloud (code quality) with SAST (security) Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/codeql-analysis.yml | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..0b16500 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,37 @@ +name: CodeQL + +on: + push: + branches: ["main"] + pull_request: + branches: ["main"] + schedule: + - cron: "0 6 * * 1" # Weekly Monday 6am UTC + +concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + if: "! github.event.pull_request.draft" + permissions: + security-events: write + contents: read + strategy: + fail-fast: false + matrix: + language: [python, javascript] + + steps: + - uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 From efc96fa53e003c2c5c4ba364079c18f26e808012 Mon Sep 17 00:00:00 2001 From: abhizipstack Date: Mon, 6 Apr 2026 13:30:33 +0530 Subject: [PATCH 2/2] fix: move concurrency inside job to avoid matrix jobs cancelling each other Concurrency group now includes matrix.language so Python and JavaScript analysis run independently without cancelling each other. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/codeql-analysis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0b16500..d2f7768 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -8,15 +8,14 @@ on: schedule: - cron: "0 6 * * 1" # Weekly Monday 6am UTC -concurrency: - group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} - cancel-in-progress: true - jobs: analyze: name: Analyze (${{ matrix.language }}) runs-on: ubuntu-latest if: "! github.event.pull_request.draft" + concurrency: + group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}-${{ matrix.language }} + cancel-in-progress: true permissions: security-events: write contents: read