From 5b2db7e66569c8c6e542140c21f51f7431ec76f7 Mon Sep 17 00:00:00 2001 From: Dylan Ravel Date: Wed, 18 Mar 2026 19:19:09 -0700 Subject: [PATCH] Add CodeQL workflow for Go Add .github/workflows/codeql.yml to run GitHub CodeQL analysis for the Go codebase. The workflow triggers on pushes and pull requests to main and weekly via cron, sets read/write permissions for contents and security events, sets up Go 1.25, initializes CodeQL, builds the project (go build ./...) and performs the analysis to automate regular security scanning. --- .github/workflows/codeql.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 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 0000000..63f1bb8 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,39 @@ +name: CodeQL + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + schedule: + - cron: '0 0 * * 1' + +permissions: + contents: read + security-events: write + +jobs: + analyze: + name: Analyze (go) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.25' + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: go + + - name: Build + run: go build -v ./... + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: /language:go