From 34edda5f6e2d17354b45aa199fcb7438c028f4ab Mon Sep 17 00:00:00 2001 From: Abhinav Agarwal Date: Mon, 18 May 2026 20:53:50 -0700 Subject: [PATCH] ci: add CodeQL static analysis - New codeql.yml with manual build mode for C/C++ analysis - Uses security-extended query suite, triggers on push/PR to master plus weekly schedule - Upgraded to CodeQL Action v4 with full SHA pins - Permissions scoped to contents: read and security-events: write - Pin runner to ubuntu-24.04, add setup-python for PEP 668 compatibility, add job timeout --- .github/workflows/codeql.yml | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 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..3534bc04 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,51 @@ +name: CodeQL + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + security-events: write + +jobs: + analyze: + name: Analyze C + runs-on: ubuntu-24.04 + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set up Python + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: '3.12' + + - name: Initialize CodeQL + uses: github/codeql-action/init@bc0b696b4103f5fe60f15749af68a046868d511a # codeql-bundle-v2.25.4 + with: + languages: c-cpp + build-mode: manual + queries: security-extended + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y gcc ninja-build pkg-config libglib2.0-dev libfuse3-dev + pip3 install meson + + - name: Build + run: | + meson setup build --buildtype=debug + ninja -C build sshfs + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@bc0b696b4103f5fe60f15749af68a046868d511a # codeql-bundle-v2.25.4