From 5030360a0cc3db6a94d254b9b93032ed5f725abc Mon Sep 17 00:00:00 2001 From: kingchenc Date: Sun, 31 May 2026 22:34:00 +0200 Subject: [PATCH] ci: CodeQL SAST workflow + badge (P13.6) (#96) * ci: add OpenSSF Scorecard workflow + badge (P13.1) * ci(release): attest build provenance for crates + Python artifacts (P13.2) * docs(readme): add GitHub release badge (P13.4) * ci: add CodeQL SAST workflow + badge (P13.6) --- .github/workflows/codeql.yml | 47 ++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 48 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..b5a97ba1 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,47 @@ +name: CodeQL + +# Static analysis security testing (findings P13.x). Analyses the Rust core and +# the Python / JavaScript binding surfaces with GitHub's CodeQL engine. Results +# appear under Security → Code scanning. `build-mode: none` analyses source +# directly — no compilation step — for every language here. +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: '31 3 * * 0' # Sundays 03:31 UTC + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + permissions: + security-events: write # upload CodeQL results to code-scanning + packages: read + actions: read + contents: read + strategy: + fail-fast: false + matrix: + include: + - language: rust + build-mode: none + - language: python + build-mode: none + - language: javascript-typescript + build-mode: none + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - name: Perform CodeQL analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{ matrix.language }}" diff --git a/README.md b/README.md index b8b68c1e..fac20f7c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Wickra [![CI](https://github.com/wickra-lib/wickra/actions/workflows/ci.yml/badge.svg)](https://github.com/wickra-lib/wickra/actions/workflows/ci.yml) +[![CodeQL](https://github.com/wickra-lib/wickra/actions/workflows/codeql.yml/badge.svg)](https://github.com/wickra-lib/wickra/actions/workflows/codeql.yml) [![codecov](https://codecov.io/gh/wickra-lib/wickra/branch/main/graph/badge.svg)](https://codecov.io/gh/wickra-lib/wickra) [![GitHub release](https://img.shields.io/github/v/release/wickra-lib/wickra?logo=github&color=green)](https://github.com/wickra-lib/wickra/releases/latest) [![crates.io](https://img.shields.io/crates/v/wickra.svg?logo=rust&color=orange)](https://crates.io/crates/wickra)