Skip to content

ci: nightly CI on dev and GHCR latest security scan - #475

Merged
c-vigo merged 4 commits into
devfrom
feature/461-nightly-ci-security-scan
Apr 2, 2026
Merged

c-vigo merged 4 commits into
devfrom
feature/461-nightly-ci-security-scan

Conversation

@c-vigo

@c-vigo c-vigo commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a nightly CI schedule on dev so the full pipeline (build, tests, Python security, Trivy) runs without waiting for a PR. Reworks the scheduled security workflow to run nightly, pull ghcr.io/vig-os/devcontainer:latest (no rebuild), run Trivy/SBOM/SARIF with category container-image-latest, and fail the workflow when fixable HIGH/CRITICAL findings remain after .trivyignore, with a deduplicated GitHub issue on failure. PR and workflow_dispatch behavior for CI is unchanged aside from scheduled checkout ref handling.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • .github/workflows/ci.yml
    • Add schedule cron at 04:00 UTC; on schedule, checkout ref: dev across jobs.
    • Emit vcs_ref from the checked-out commit and pass it to build-image as vcs-ref so the image metadata matches the scheduled tree.
  • .github/workflows/security-scan.yml
    • Replace weekly dev rebuild + scan with nightly scan-latest: pull GHCR :latest, Trivy table (awareness), gated scan on fixable HIGH/CRITICAL, SBOM + SARIF upload, step summary, optional gh issue create when the gate fails, distinct SARIF category container-image-latest.
  • CHANGELOG.md and assets/workspace/.devcontainer/CHANGELOG.md
    • Document nightly CI, scheduled scan behavior, and security gate under Unreleased.

Changelog Entry

@@ -32,6 +32,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
   - Add `just promote-release` in `justfile.gh` (and workspace template copy)
 - **Smoke-test dispatch fails fast when deploy PR checks fail** ([#381](https://github.com/vig-os/devcontainer/issues/381))
   - `wait-deploy-merge` in `assets/smoke-test/.github/workflows/repository-dispatch.yml` exits as soon as all required checks have completed with failures instead of waiting for the merge poll timeout (`gh pr checks --required`)
+- **Nightly CI schedule** ([#461](https://github.com/vig-os/devcontainer/issues/461))
+  - `ci.yml` adds a `schedule` trigger at 04:00 UTC that checks out `dev` and runs all test suites; checkout `ref` and `vcs-ref` are resolved correctly for scheduled runs
+- **Scheduled security scan pulls GHCR `:latest` instead of rebuilding** ([#461](https://github.com/vig-os/devcontainer/issues/461))
+  - Runs nightly at 05:00 UTC, pulls the published image, gates on fixable HIGH/CRITICAL vulnerabilities, auto-creates a deduplicated GitHub issue on failure, and uploads SARIF under `container-image-latest`
 
 ### Deprecated
 
@@ -60,6 +64,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ### Security
 
+- **Nightly vulnerability gate for published container image** ([#461](https://github.com/vig-os/devcontainer/issues/461))
+  - Scheduled security scan now fails on fixable HIGH/CRITICAL CVEs and auto-files a GitHub issue, replacing the previous non-blocking weekly scan
+
 ## [0.3.1](https://github.com/vig-os/devcontainer/releases/tag/0.3.1) - 2026-03-26

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

just test-bats was run successfully before the workflow commits (shell/just coverage). Full just test (image + integration) was not run for this PR.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

N/A

Refs: #461

@c-vigo c-vigo self-assigned this Apr 2, 2026
@c-vigo
c-vigo requested a review from Copilot April 2, 2026 10:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds nightly automation to catch regressions and vulnerabilities without requiring PR activity, including a scheduled CI run against dev and a nightly security scan of the published :latest GHCR image with Trivy/SBOM/SARIF and an alerting mechanism.

Changes:

  • Schedule ci.yml nightly at 04:00 UTC and ensure scheduled runs explicitly check out dev, with vcs-ref derived from the checked-out commit.
  • Rework security-scan.yml to run nightly at 05:00 UTC by pulling ghcr.io/vig-os/devcontainer:latest (no rebuild) and gating on fixable HIGH/CRITICAL findings, plus SBOM/SARIF upload and issue creation on gate failure.
  • Document the new nightly CI and security gate behavior in both changelogs.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/ci.yml Adds a nightly schedule and uses scheduled checkout targeting dev; propagates resolved commit to image metadata.
.github/workflows/security-scan.yml Switches to nightly scan of GHCR :latest, adds gating, SBOM/SARIF artifacts, and deduplicated issue creation on failures.
CHANGELOG.md Documents nightly CI and the updated scheduled security scan behavior.
assets/workspace/.devcontainer/CHANGELOG.md Mirrors changelog updates for the workspace template.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/security-scan.yml Resolved
Comment thread .github/workflows/security-scan.yml Resolved
- Hard-fail scan-latest when GHCR image pull fails so missed scans are
  surfaced to watchers instead of silently passing.
- Fix jq filter `.[0].number` returning literal "null" on empty results,
  which skipped issue creation on first gate failure; use `// empty`.

Refs: #461
@c-vigo
c-vigo enabled auto-merge April 2, 2026 11:09
@c-vigo
c-vigo merged commit 7c2980f into dev Apr 2, 2026
11 checks passed
@c-vigo
c-vigo deleted the feature/461-nightly-ci-security-scan branch April 2, 2026 11:16
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.

2 participants