Build ErsatzTV Image / CI toolchain image resolves (push) Successful in 7s
Build ErsatzTV Image / Delimiter ban (release path) (push) Successful in 25s
Build ErsatzTV Image / Build & test (.NET) (push) Successful in 8m41s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (push) Successful in 6m21s
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (push) Successful in 5m58s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (push) Skipped
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (push) Skipped
Build ErsatzTV Image / Build & push image (amd64) (push) Successful in 4m8s
Closes #786 and #789, bundled because working either alone would build the artifact the other removes. Every job in all six tracked workflows declares `env.CI_JOB_ROLE` (guard/report-only/none); the `docker-build.yml` jobs also declare `env.CI_EXECUTION_CLASS` (toolchain/bare-runner). Both guard populations derive from those markers; the `TOOLCHAIN_JOBS`/`BARE_RUNNER_JOBS` literals are deleted. A missing or unrecognised marker is a hard failure in both checkers. #789's literal had a real justification — set equality between two DERIVED sets is blind to a member leaving both at once — so the marker is the anchor that replaces it, and the cost (proximity to the `container:` block) is paid by a THIRD derivation from each job's own steps, which is also the only check that sees the failure #789 filed: a .NET step moved into a bare-runner job, where no set changes. The residual is disclosed: drop the block, flip the marker AND hide the tool behind a script and all three go blind, bounded by the failure mode being a loud missing-binary crash. #786's guard jobs join a machine-checked population: a new `test_workflow_job_guards.py` asserts set equality both ways against a new "Workflow-job guards" table, and the four jobs with no dropped-step guard each carry a recorded decision. Two issue claims were refuted by measurement: #789's "editing docker-build.yml re-points the pin" (the pathspec is `docker/ci` only) and #786's job count (17, not 15). Four cold adversarial review rounds across two model families; rounds 1-3 BLOCKED, all findings fixed and each fix demonstrated by reproducing the reviewer's own test. The recurring defect class was prose drifting from code, including a mechanism claim in the decision record that execution refuted. All five mutation proofs redden when their shipped detector is disarmed. New decision record: `testing.workflow-declares-its-own-job-metadata`. Co-authored-by: Timothy <timothy@noreply.gitea.tblindustries.be>
84 lines
3.7 KiB
YAML
84 lines
3.7 KiB
YAML
name: Dependency vulnerability scan
|
|
|
|
# Scheduled NuGet advisory scan — a Gitea-native stand-in for Dependabot (ersatztv#14).
|
|
# Surfaces vulnerable direct/transitive packages on a schedule instead of only when a
|
|
# `dotnet restore` happens to break. This is DETECTION ONLY; automated update PRs are
|
|
# tracked separately (self-hosted Renovate — server-management#484).
|
|
#
|
|
# Scans the FULL solution (including the Scanner project, which the image build strips)
|
|
# so coverage isn't narrower than the code we ship.
|
|
#
|
|
# NOTE: Gitea runs `schedule` triggers only from the default branch (main); the workflow
|
|
# must be merged to main before the cron registers. Use `workflow_dispatch` to run on demand.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
# Mondays 06:00 UTC
|
|
- cron: '0 6 * * 1'
|
|
|
|
# Independent of the build pipeline's concurrency group; a stale scan can be cancelled.
|
|
concurrency:
|
|
group: ersatztv-depscan
|
|
cancel-in-progress: true
|
|
|
|
# No persistent MSBuild/Roslyn servers (ersatztv#406). Workflow `env:` does not cross workflow
|
|
# files, so docker-build.yml's copy of these does not apply here and this has to be repeated.
|
|
# Smaller stakes than the build pipeline — `dotnet restore` + `dotnet list` are MSBuild-driven and
|
|
# never invoke csc, so this is lingering worker nodes (hundreds of MiB), not a 7.8 GB VBCSCompiler.
|
|
# Worth setting anyway: this runs unattended on a Monday 06:00 cron against the same host that runs
|
|
# prod media, and node reuse keeps workers alive ~15 min after the job.
|
|
env:
|
|
UseSharedCompilation: "false"
|
|
DOTNET_CLI_USE_MSBUILD_SERVER: "0"
|
|
MSBUILDDISABLENODEREUSE: "1"
|
|
|
|
# Explicit token scope (ersatztv#748) so the owner-level Actions default can move to Restricted
|
|
# (server-management#714). Declaring `permissions:` is EXHAUSTIVE, not additive: a unit omitted here
|
|
# is NOT granted, and that holds at any owner default — it is not conditional on Restricted being on.
|
|
# Only `review-verdict.yml` needs write; it declares that at the job and says why there. Full
|
|
# rationale and the per-workflow credential audit: docs/ci-cd.md -> "Workflow token scope".
|
|
# Holds no registry credential and reads nothing from the Gitea API; the injected GITEA_TOKEN serves
|
|
# only its one `actions/checkout`.
|
|
permissions:
|
|
code: read
|
|
|
|
jobs:
|
|
scan:
|
|
name: NuGet vulnerable packages
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CI_JOB_ROLE: guard
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: '10.0.x'
|
|
|
|
- name: Restore
|
|
run: dotnet restore ErsatzTV.sln
|
|
|
|
- name: Scan for vulnerable packages (direct + transitive)
|
|
# bash + `set -euo pipefail` so a failing `dotnet list` (e.g. the audit source
|
|
# is unreachable while restore served from cache) fails the job instead of
|
|
# falling through to a false "no vulnerable packages" green.
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
echo "Running: dotnet list package --vulnerable --include-transitive"
|
|
dotnet list ErsatzTV.sln package --vulnerable --include-transitive 2>&1 | tee depscan.txt
|
|
# `dotnet list package --vulnerable` exits 0 even when advisories exist, so detect
|
|
# findings by the report marker and fail the run if any are present. Expect this to
|
|
# be RED until ersatztv#8 clears the current NCalcSync / SQLitePCLRaw advisories;
|
|
# after that, a red run means a NEW advisory has appeared.
|
|
if grep -q "has the following vulnerable packages" depscan.txt; then
|
|
echo "::error::Vulnerable NuGet packages detected — see report above (tracked: ersatztv#8)."
|
|
exit 1
|
|
fi
|
|
echo "No vulnerable packages found."
|