ci: add CodeQL scanning, format check, and .env.example

Add weekly CodeQL analysis for C# code. Add dotnet format
verification step to CI. Create .env.example documenting
required environment variables.

Co-Authored-By: Svrnty Inc. <eng@svrnty.com>
This commit is contained in:
Svrnty 2026-02-27 21:09:14 -05:00
parent 7ead822067
commit 1f12cc8c59
3 changed files with 59 additions and 0 deletions

9
.env.example Normal file
View File

@ -0,0 +1,9 @@
# dotnet-cqrs Environment Configuration
# Copy to .env and fill in values before running
# NuGet publishing (required for dotnet pack + push)
NUGET_API_KEY=
# Application URLs (for Svrnty.Sample project)
ASPNETCORE_URLS=http://localhost:19898
ASPNETCORE_ENVIRONMENT=Development

View File

@ -32,3 +32,6 @@ jobs:
- name: Test
run: dotnet test Svrnty.CQRS.sln --no-build --verbosity normal
- name: Format check
run: dotnet format Svrnty.CQRS.sln --verify-no-changes

47
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: CodeQL
on:
push:
branches: [JP]
pull_request:
branches: [JP]
schedule:
- cron: "0 8 * * 1" # Weekly on Monday at 08:00 UTC
concurrency:
group: codeql-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read
security-events: write
jobs:
analyze:
name: CodeQL Analysis
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [csharp]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Build
run: dotnet build Svrnty.CQRS.sln
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"