Files
CommandForge/.github/workflows/codeql.yml
T
poli0981andClaude Opus 5.5 d2dcebc6dd ci: address review and SonarCloud findings in workflows
- release.yml: upload the Velopack release as a draft, attach SBOM + checksums, then publish
  (publishing is what makes installed copies auto-update); VirusTotal runs after publishing
  because the release-by-tag API cannot see drafts.
- notify-ci-failure.yml: filter on the triggering event (`push`) instead of the forgeable actor
  login (SonarCloud githubactions:S8232).
- scorecard.yml: top-level `contents: read` instead of `read-all` (githubactions:S8234).
- codeql.yml: build with -p:RunAnalyzers=false; Roslyn analyzers add nothing to the extraction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 20:02:41 +07:00

68 lines
2.0 KiB
YAML

name: CodeQL
# Project-specific CodeQL (not the shared reusable workflow): the C# code is a WPF
# (net10.0-windows) app that only builds on Windows from a .slnx solution. The workflows
# themselves are analysed too (`actions` language).
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '37 14 * * 1' # Mondays 14:37 UTC
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- language: csharp
os: windows-latest
build-mode: manual
- language: actions
os: ubuntu-latest
build-mode: none
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- if: matrix.language == 'csharp'
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
global-json-file: global.json
- name: Initialize CodeQL
uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
- if: matrix.build-mode == 'manual'
name: Build
# Roslyn analyzers add nothing to CodeQL's extraction and slow the traced build down.
run: dotnet build CommandForge.slnx -c Release -p:RunAnalyzers=false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
category: "/language:${{ matrix.language }}"