Skip to content

ci: enable incremental dependency-check updates - #20126

Draft
FrankChen021 wants to merge 7 commits into
masterfrom
codex/dependency-check-incremental-cache
Draft

ci: enable incremental dependency-check updates#20126
FrankChen021 wants to merge 7 commits into
masterfrom
codex/dependency-check-incremental-cache

Conversation

@FrankChen021

Copy link
Copy Markdown
Member

Description

  • stop purging the OWASP Dependency-Check database before every scan
  • restore and save the database through a dedicated GitHub Actions cache
  • use a stable data directory and a 24-hour NVD freshness window
  • add a manual workflow trigger for validation

Testing

  • git diff --check
  • YAML parse validation
  • Dependency-Check 12.2.0 parameter validation
  • Cron Job ITs workflow run to be triggered after PR creation

The first run is expected to initialize the cache; a subsequent run will verify that the cached database is restored and only incremental NVD updates are downloaded.

@github-actions github-actions Bot added the GHA label Aug 24, 2026
@FrankChen021

Copy link
Copy Markdown
Member Author

Dependency-Check cache validation for commit 32629a3:

  • Initial PR run 32743390989: the cache was initially absent, Dependency-Check downloaded the full NVD set (382,070 records), and the workflow saved the cache with key dependency-check-data-Linux-odc-12.2.2-32743390989.
  • Follow-up run 32756643364: the restore step reported "Cache not found" for the odc-12.2.2 keys, so it downloaded the full NVD set again (382,161 records). It later logged "Skipping the NVD API Update as it was completed within the last 240 minutes."

Conclusion: this follow-up did not demonstrate an Actions cache hit or incremental NVD update. The version-scoped key is present, but the cache saved by the pull_request run was not visible to this workflow_dispatch run, likely because of GitHub Actions cache scope by event/ref. Both runs failed on CVSS >= 7 findings after the scan; neither showed the previous URL-length database-schema error.

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Severity Findings
P0 0
P1 1
P2 0
P3 0
Total 1

The review found one P1 workflow correctness issue: the refreshed dependency-check cache is not saved when the preceding vulnerability scan fails.

Reviewed 2 of 2 changed files.


This is an automated review by Codex GPT-5.6-Luna(max)

- name: Save Dependency-Check data
# A pull_request run uses an isolated merge-ref cache that cannot be
# reused by branch, scheduled, or workflow_dispatch runs.
if: steps.dependency-check-update.outcome == 'success' && github.event_name != 'pull_request'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

[P1] Updated cache is skipped when the scan fails

Because this condition has no status function, GitHub Actions implicitly requires success(). The preceding security scan intentionally fails when vulnerabilities are found, so this save step is skipped even when dependency-check-update succeeded. The workflow therefore cannot persist the refreshed database on the observed failure path and will repeatedly download the full NVD dataset. Include an explicit always() or equivalent status condition while retaining the update-success and non-PR checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant