Skip to content

feat: run trivy daily at 6AM UTC and create Copilot issue for CVEs - #389

Merged
britaniar merged 3 commits into
mainfrom
britaniar-trivy-workflow-auto-pr
Jul 29, 2026
Merged

feat: run trivy daily at 6AM UTC and create Copilot issue for CVEs#389
britaniar merged 3 commits into
mainfrom
britaniar-trivy-workflow-auto-pr

Conversation

@britaniar

Copy link
Copy Markdown
Contributor

Summary

Updates the Trivy vulnerability scanner workflow to run on a daily schedule and automatically create GitHub Issues assigned to the Copilot coding agent when CVEs are found.

Changes

  • Daily schedule: Added cron trigger 0 6 * * * (6:00 AM UTC) to catch overnight CVE disclosures.
  • JSON output: Trivy now outputs JSON for programmatic parsing of vulnerability details.
  • Copilot auto-remediation: On scheduled runs, if HIGH/CRITICAL CVEs are found, a GitHub Issue is created with a structured table of affected packages and fix versions, assigned to copilot to automatically open a fix PR.
  • Non-scheduled behavior preserved: Push/tag/manual runs still fail the build on vulnerabilities (same as before).
  • Deduplication: Checks for existing open issues with the same title before creating a new one.

Prerequisites

  • security and trivy labels must exist in the repository.
  • Copilot coding agent must be enabled for this repository.

Why

Dependabot doesn't run frequently enough to address CVEs in container images in a timely manner. This gives us a daily scan with automated fix PRs via Copilot.

britaniar and others added 2 commits July 28, 2026 10:15
- Add schedule cron trigger (0 6 * * *)
- Output trivy results as JSON for programmatic parsing
- On scheduled runs with CVEs, create a GitHub Issue assigned to copilot
- On push/tag runs, still fail the build on vulnerabilities
- Deduplicate issues by checking for existing open issue with same title
- Add issues:write permission

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.06%. Comparing base (5b22264) to head (f839c80).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #389      +/-   ##
==========================================
- Coverage   67.55%   67.06%   -0.50%     
==========================================
  Files          33       33              
  Lines        4889     3783    -1106     
==========================================
- Hits         3303     2537     -766     
+ Misses       1410     1072     -338     
+ Partials      176      174       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@britaniar

Copy link
Copy Markdown
Contributor Author

Thanks -- coverage looks good. The slight decrease is expected since this PR only adds workflow YAML (no coverable Go code) while the base had some lines removed elsewhere.

@michaelawyu michaelawyu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM ;)

@britaniar
britaniar merged commit ade0b7e into main Jul 29, 2026
10 of 11 checks passed
@britaniar
britaniar deleted the britaniar-trivy-workflow-auto-pr branch July 29, 2026 18: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.

2 participants