From 0635ad98f3c8e12f47b7e5b3bd79822707566f35 Mon Sep 17 00:00:00 2001 From: zeevdr Date: Mon, 27 Apr 2026 15:22:40 +0300 Subject: [PATCH] ci: add CodeQL advanced setup workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces default-setup. Advanced unlocks paths-ignore for generated code (api/centralconfig/v1, internal/storage/dbstore/*.gen.go) and Go module caching across runs — projected ~1-2 min faster vs default-setup. Matches default-setup's `default` query suite and `remote` threat model for findings parity. Languages: actions, go, python. Default-setup must be disabled in repo settings post-merge for this workflow's uploads to take effect. Refs #183 Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/codeql.yml | 73 ++++++++++++++++++++++++++++++++++++ 1 file changed, 73 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 00000000..4888b1b8 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,73 @@ +# CodeQL advanced setup. Replaces default-setup once disabled in repo settings. +# Advanced unlocks paths-ignore (skip generated code) and Go module caching +# across runs — projected ~1-2 min faster vs default-setup. +name: CodeQL + +on: + pull_request: + branches: [main] + paths-ignore: + - "api/centralconfig/v1/**" + - "internal/storage/dbstore/*.gen.go" + - "**/*.md" + push: + branches: [main] + schedule: + - cron: "23 7 * * 1" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + security-events: write + packages: read + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: go + build-mode: autobuild + - language: python + build-mode: none + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Go + if: matrix.language == 'go' + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + config: | + paths-ignore: + - api/centralconfig/v1/** + - internal/storage/dbstore/*.gen.go + + - name: Analyze + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{ matrix.language }}"