Skip to content

fix(ci): optimize analysis jobs - #2811

Open
DerekRoberts wants to merge 10 commits into
mainfrom
feat/trivy-analysis-improvements
Open

fix(ci): optimize analysis jobs#2811
DerekRoberts wants to merge 10 commits into
mainfrom
feat/trivy-analysis-improvements

Conversation

@DerekRoberts

@DerekRoberts DerekRoberts commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

This PR consolidates the repository's test and security scanning logic into a single reusable-analysis.yml workflow, eliminating redundancies and ensuring exact testing parity across all GitHub events.

Architectural Changes:

  1. Unified Analysis Workflow: Migrated backend-tests, frontend-tests, and trivy scanning into .github/workflows/reusable-analysis.yml.
  2. Removed Trigger Racing: Deleted the standalone analysis.yml file. PRs will now only trigger pr-open.yml (which calls the reusable workflow).
  3. Consolidated PR Gate: Updated the results check in pr-open.yml to wait for both deployment jobs and the new analysis workflow call.
  4. Trivy Optimizations: Includes path triggers (diff-triggers), dynamic caching (hashFiles), and strict exit code gating (exit-code: 1) for secrets and misconfigurations.

⚠️ WARNING TO MAINTAINERS: Before merging this, you MUST update the Branch Protection Rules for main to require PR Results instead of Analysis Results.


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

Copilot AI lite review requested due to automatic review settings August 7, 2026 22:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the GitHub Actions Trivy security scan job to reduce unnecessary runs and tighten enforcement by gating secrets/misconfiguration findings while still publishing vulnerability results to the Security tab.

Changes:

  • Adds bcgov/actions/diff-triggers path-based filtering to skip Trivy on non-impacting changes.
  • Updates the Trivy DB cache key to be derived from hashFiles('.github/workflows/analysis.yml') instead of a hardcoded version string.
  • Splits Trivy scanning so secrets/misconfig failures gate the workflow (exit-code: 1) while vulnerability reporting remains non-blocking (exit-code: 0) and still uploads SARIF.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/reusable-analysis.yml Outdated
Comment thread .github/workflows/reusable-analysis.yml Outdated
@DerekRoberts DerekRoberts moved this from New to Active in DevOps (NR) Aug 7, 2026
@DerekRoberts DerekRoberts self-assigned this Aug 7, 2026
@DerekRoberts DerekRoberts changed the title fix(ci): optimize Trivy analysis workflow with path triggers, dynamic caching, and secret gates fix(ci): optimize Trivy Aug 7, 2026
@DerekRoberts DerekRoberts changed the title fix(ci): optimize Trivy refactor(ci): consolidate analysis workflows Aug 7, 2026
@DerekRoberts DerekRoberts changed the title refactor(ci): consolidate analysis workflows fix(ci): optimize analysis jobs Aug 7, 2026
@DerekRoberts
DerekRoberts marked this pull request as draft August 8, 2026 00:06
@DerekRoberts
DerekRoberts marked this pull request as ready for review August 8, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Active

Development

Successfully merging this pull request may close these issues.

2 participants