Skip to content

ci: add CodeQL (push/weekly) + FOSSA (push + release gate)#24

Merged
cosmin-staicu merged 3 commits into
mainfrom
ci/codeql-fossa
Jun 23, 2026
Merged

ci: add CodeQL (push/weekly) + FOSSA (push + release gate)#24
cosmin-staicu merged 3 commits into
mainfrom
ci/codeql-fossa

Conversation

@cosmin-staicu

Copy link
Copy Markdown
Member

Adds the two scans, with FOSSA configured to fail the build on CVE/license policy violations (per the requirement — a red check is the trigger, no need to watch the dashboard).

CodeQL — codeql.yml

  • C# analysis on push to main + weekly cron (Mon 04:23 UTC).
  • Manual build (dotnet build the slnx between init/analyze) for reliable multi-target + central-package-management.
  • Reports to the Security tab. No secret needed.
  • ⚠️ Requires the repo to be public or GitHub Advanced Security enabled — otherwise CodeQL can't upload results and the run fails. Activates cleanly once public/GHAS-on.

FOSSA

  • ci.ymlfossa analyze + fossa test on push to main only (not PRs). run-tests: true → the job fails on any license or CVE policy violation.
  • release.yml — same FOSSA gate in the release job (before Create Release), so a release can't publish with an open license/CVE issue; publish jobs need release.
  • Both gated on the FOSSA_API_KEY secret, so they skip (green) until it's set.

Requirement note

For fossa test to flag CVEs and license issues, the FOSSA project's policy must enable vulnerability scanning + license rules. The gate enforces whatever that policy flags.

To activate

Add secret FOSSA_API_KEY (from app.fossa.com). CodeQL needs public/GHAS.

- codeql.yml: CodeQL C# analysis on push to main + weekly cron (manual build).
- ci.yml: FOSSA analyze+test on push to main only, gating on license/CVE
  policy violations (run-tests: true → red build is the trigger). Gated on
  FOSSA_API_KEY so PRs and unconfigured repos stay green.
- release.yml: FOSSA analyze+test as a release gate (before Create Release),
  so a release can't publish with an open license/CVE issue.
Per the company FOSSA-in-CI guidance, run the scan as its own parallel job
(push to main only) so it doesn't delay the build, instead of inside
build-linux. Add .fossa.yml to scope the scan to shipped code — exclude
tests/samples/benchmarks (dev-only deps are never redistributed). The
release-gate FOSSA step (release.yml) is unchanged.
@sonarqubecloud

Copy link
Copy Markdown

@cosmin-staicu
cosmin-staicu merged commit f5a730b into main Jun 23, 2026
6 checks passed
@cosmin-staicu
cosmin-staicu deleted the ci/codeql-fossa branch June 23, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant