Skip to content

bug: GitHub Action passes --no-cache with offline mode, which the CLI rejects #867

Description

@Ayush7614

Summary

The GitHub Action defaults no-cache to "true" and always appends --no-cache when that input is true. Offline mode (offline, offline-db, or sync-advisories) also appends --offline-db. The CLI treats those flags as mutually exclusive, so the default Action offline config fails before scanning.

Expected

- uses: OWASP/cve-lite-cli@v1
  with:
    offline: "true"
    # no-cache left at default "true"

Should run an offline scan successfully. --no-cache is meaningless offline (no OSV query cache to bypass).

Actual

CLI exits 1 immediately:

Error: --no-cache cannot be used with --offline or --offline-db

Root cause

action.yml:

  • no-cache input defaults to "true" (CI-oriented)
  • scan step (and fix step) independently append --offline-db when USE_OFFLINE=true and --no-cache when INPUT_NO_CACHE=true

src/cli/validate.ts:

if (options.noCache && (options.offline || options.offlineDb)) {
  throw new Error("--no-cache cannot be used with --offline or --offline-db");
}

Docs (website/docs/caching.md, CHANGELOG) document the same mutual exclusion.

Impact

Any Action workflow that enables offline scanning without explicitly setting no-cache: "false" is broken out of the box — including offline: true, offline-db: ..., and sync-advisories: true.

Suggested fix

When USE_OFFLINE=true, omit --no-cache from the constructed CLI args (scan + fix steps). Optionally document that no-cache is ignored in offline mode.

Workaround today: set no-cache: "false" whenever offline inputs are used.

Reproduce

# Equivalent to what the Action builds by default for offline scans:
cve-lite . --offline-db ./.cache/cve-lite/advisories.db --no-cache
# Error: --no-cache cannot be used with --offline or --offline-db

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions