Skip to content

fix: warn and suppress fail-on exit when fix mode is active in the Ac…#828

Open
coder-Yash886 wants to merge 1 commit into
OWASP:mainfrom
coder-Yash886:fix/action-fail-on-fix-mode
Open

fix: warn and suppress fail-on exit when fix mode is active in the Ac…#828
coder-Yash886 wants to merge 1 commit into
OWASP:mainfrom
coder-Yash886:fix/action-fail-on-fix-mode

Conversation

@coder-Yash886

Copy link
Copy Markdown
Contributor

Summary
When a workflow sets both fail-on and fix: true, the scan step exits non-zero on findings before the "Apply security fixes" step runs. CLI-level fail-on suppression only applies when --fix and --fail-on are passed in the same invocation; in the Action they run in separate steps, so that behavior never helped.

This change updates the "Run CVE Lite CLI scan" step in action.yml to:

Emit a GitHub Actions warning when fix: true and fail-on are both set, so users know fail-on has no effect in fix mode
Suppress the scan step exit code when fix: true is active (cve-lite ... || true), so the fix step always runs regardless of findings
Closes #792

Test plan

Run a workflow with fix: true and fail-on: high on a project that has high-severity findings — scan step should not fail the job, and "Apply security fixes" should run

Confirm the workflow logs show ::warning::fail-on is set but has no effect in fix mode... when both inputs are set

Run a workflow with fail-on: high and fix: false — scan step should still exit non-zero on matching findings (unchanged behavior)

Run a workflow with fix: true and no fail-on — fix step runs normally with no warning

@coder-Yash886

Copy link
Copy Markdown
Contributor Author

@sonukapoor Please review the Pr when you have free time

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.

fix: warn and suppress fail-on exit when fix mode is active in the Action

1 participant