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>
This commit is contained in:
poli0981andClaude Opus 5.5 committed 2026-10-21 20:02:41 +07:00
1 parent 304693cfa0
commit d2dcebc6dd
4 files changed
+18 -6

No files matched your search

+2 -1
View File
@@ -58,7 +58,8 @@ jobs:
- if: matrix.build-mode == 'manual'
name: Build
run: dotnet build CommandForge.slnx -c Release
# 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
+4 -2
View File
@@ -16,9 +16,11 @@ permissions:
jobs:
notify:
# Dependabot-triggered runs get no Actions secrets, so the required webhook is unavailable.
# Build only runs on `push` for main, so this limits alerts to main without trusting
# forgeable values (branch names, actor logins) — and skips pull-request runs (including
# Dependabot's), which have no access to the webhook secret anyway.
if: >-
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.actor.login != 'dependabot[bot]'
github.event.workflow_run.event == 'push'
uses: poli0981/.github/.github/workflows/notify-ci-failure.yml@main
secrets: inherit
+10 -2
View File
@@ -89,7 +89,9 @@ jobs:
Releases/*-Setup.exe
Releases/*.nupkg
- name: Publish GitHub Release (Velopack)
# Upload as a DRAFT first: publishing is what makes installed copies auto-update, so the
# release only goes live once every asset (SBOM, checksums, scan links) is attached.
- name: Create draft GitHub Release (Velopack)
shell: pwsh
env:
VERSION: ${{ steps.ver.outputs.version }}
@@ -98,7 +100,6 @@ jobs:
dotnet vpk upload github
--repoUrl $env:REPO_URL
--token $env:GH_TOKEN
--publish
--releaseName "CommandForge $env:VERSION"
--tag $env:TAG
@@ -121,6 +122,13 @@ jobs:
Out-File $checksums -Encoding ascii
gh release upload $env:TAG $sbom $checksums --clobber
- name: Publish the release
shell: pwsh
env:
TAG: ${{ steps.ver.outputs.tag }}
run: gh release edit $env:TAG --draft=false --latest
# The release-by-tag API used to append scan links can't see drafts, so this runs after publishing.
- name: VirusTotal scan (optional)
if: env.VT_API_KEY != ''
uses: crazy-max/ghaction-virustotal@936d8c5c00afe97d3d9a1af26d017cfdf26800a2 # v5.0.0
+2 -1
View File
@@ -10,7 +10,8 @@ on:
branches: [main]
workflow_dispatch:
permissions: read-all
permissions:
contents: read
jobs:
analysis: