From 17d36c25c51bff211ae1a1cb6ec04546e099ab64 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 3 Nov 2026 20:34:16 +0800 Subject: [PATCH] fix(ci): batch main CodeQL scans weekly --- .ci-policy.md | 1 + .github/workflows/codeql.yml | 62 ++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 2 ++ 3 files changed, 65 insertions(+) create mode 100644 .ci-policy.md create mode 100644 .github/workflows/codeql.yml diff --git a/.ci-policy.md b/.ci-policy.md new file mode 100644 index 0000000..7c37fcb --- /dev/null +++ b/.ci-policy.md @@ -0,0 +1 @@ +CodeQL scans main weekly to batch this quiet repository's changes without adding daily scans; PR/manual scans remain enabled and CI/release gates are unchanged. diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..f67be01 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,62 @@ +name: CodeQL + +on: + pull_request: + schedule: + - cron: "47 5 * * 1" + workflow_dispatch: + +permissions: + contents: read + +# Keep scheduled scans running; only superseded PR scans should be cancelled. +concurrency: + group: codeql-${{ github.event_name }}-${{ github.event_name == 'workflow_dispatch' && github.run_id || github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-24.04 + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + include: + - language: actions + build-mode: none + - language: go + build-mode: autobuild + - language: python + build-mode: none + steps: + - name: Check out source + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Set up Go + if: matrix.language == 'go' + uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version-file: go.mod + cache: false + + - name: Initialize CodeQL + uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + dependency-caching: true + + - name: Build Go source + if: matrix.build-mode == 'autobuild' + uses: github/codeql-action/autobuild@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 + + - name: Analyze + uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1 + with: + category: /language:${{ matrix.language }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2204a50..3da04aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased +- Batch main CodeQL analysis weekly while preserving PR and manual scans. + ### Dependencies - Refresh Brotli and network helpers plus the isolated Gosec SDK dependencies while retaining the Go baseline and SQLite compatibility pins.