fix(ci): make dependency audit non-blocking - #2048
Conversation
The Audit Dependencies job runs pnpm audit --prod and fails the whole CI - Main (API) workflow whenever a transitive prod dependency has an open advisory (currently hono/fast-uri/immutable). Because publishing and downstream gates key off the aggregate workflow conclusion, an unrelated audit finding turned the 4.36.0 release run red and required manual recovery. This is the same class of failure previously patched for PR plugin previews in #2046. Mark the audit job continue-on-error so it stays advisory: vulnerable dependencies are still surfaced as annotations and logs on every PR and push, but a finding no longer fails the workflow or blocks a release.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
WalkthroughThe dependency audit job is marked advisory-only, allowing the workflow to continue when the audit reports vulnerable dependencies or otherwise fails. ChangesAdvisory dependency audit
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/main.yml:
- Around line 169-171: Move continue-on-error: true from the audit job
configuration to the Audit production dependencies step, leaving checkout and
setup failures able to fail the job while only audit findings are ignored.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fb93858a-3f5e-4ab3-8860-b452a97d6dda
📒 Files selected for processing (1)
.github/workflows/main.yml
| # Advisory-only: surface vulnerable dependencies without failing the | ||
| # workflow, so an audit finding can never block a release or publish. | ||
| continue-on-error: true |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the relevant workflow section with line numbers.
sed -n '150,210p' .github/workflows/main.yml | cat -n
# Inspect whether continue-on-error appears at job or step scope elsewhere in the workflow.
rg -n "continue-on-error" .github/workflows/main.ymlRepository: unraid/api
Length of output: 2836
🌐 Web query:
GitHub Actions job-level continue-on-error step failures workflow behavior
💡 Result:
In GitHub Actions, the behavior of continue-on-error differs significantly depending on whether it is applied at the step level or the job level [1][2]. Step-Level Behavior When you set continue-on-error: true on a specific step, the workflow will continue to the next step even if that step fails [3][2]. The failed step will be reported with a "success" or "neutral" outcome in the workflow logs (though its outcome will be failure, its conclusion will be success), which allows subsequent steps to execute [2]. - If you use a conditional like if: failure in a subsequent step, it may not trigger as expected because the previous step is technically not marked as a "failure" by the runner [2]. - To check if a specific step with continue-on-error failed, you should use the step's outcome context: if: steps.<step_id>.outcome!= 'success' [2]. Job-Level Behavior Applying continue-on-error: true at the job level is designed to allow the workflow to proceed with other jobs even if the current job fails [4][5]. However, unlike step-level usage, this does not "silently" hide the failure of the job itself in the GitHub UI [5]. A job with continue-on-error: true will still be reported as a failure in the pull request and workflow summary UI if any of its steps fail, even if the workflow continues to execute subsequent dependent jobs [5]. Key Considerations - Status Checks: Because job-level continue-on-error still marks the job as a failure in the UI, it can impact status checks and branch protection rules that require specific jobs to pass [5]. - Workarounds: If you need to detect a failure in a step while still allowing the job to continue, or if you need to ensure a job fails despite a "continue-on-error" setting, you can manually exit the job in a subsequent step (e.g., run: exit 1) based on the outcome of the previous step [3][2].
Citations:
- 1: https://stackoverflow.com/questions/79803748/github-actions-job-matrix-with-continue-on-error-fails
- 2: Wrong behaviour when combining 'continue-on-error' and 'failure()' in subsequent steps actions/toolkit#1034
- 3: https://stackoverflow.com/questions/58858429/how-to-run-a-github-actions-step-even-if-the-previous-step-fails-while-still-f
- 4:
continue-on-errorshould not returnsuccessinneeds_job_resultactions/toolkit#1739 - 5: Wrong behaviour when combining 'continue-on-error' and 'failure()' in subsequent steps actions/toolkit#1034
🌐 Web query:
site:docs.github.com GitHub Actions continue-on-error job level step level semantics
💡 Result:
In GitHub Actions, the continue-on-error property functions differently depending on whether it is applied at the step level or the job level [1][2]. Step-Level Semantics When continue-on-error is set to true for an individual step, it prevents the job from failing when that specific step fails [1][2]. - The workflow execution continues to subsequent steps in the job [1][2]. - The outcome property of the step will be failure, but the final conclusion property will be success [3][4][5]. - This allows the job to proceed even if a non-critical step fails [6]. Job-Level Semantics When continue-on-error is set to true at the job level, it prevents the entire workflow run from failing if that specific job fails [1][7][8]. - If a job with continue-on-error: true fails, the job itself is considered successful regarding the overall workflow status [1]. - This is particularly useful when using a job matrix where certain experimental jobs might fail without needing to invalidate the entire workflow run [1][7][8]. In summary, step-level continue-on-error keeps a job running despite a failing step, while job-level continue-on-error keeps a workflow running despite a failing job [1]. Both properties accept boolean values and can be dynamically set using expressions [9][7][8].
Citations:
- 1: https://docs.github.com/en/enterprise-server@3.0/articles/workflow-syntax-for-github-actions
- 2: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions
- 3: https://docs.github.com/en/enterprise-server@3.17/actions/reference/workflows-and-actions/contexts
- 4: https://docs.github.com/enterprise-server@3.0/actions/learn-github-actions/contexts
- 5: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts
- 6: https://docs.github.com/en/actions/tutorials/build-and-test-code/python
- 7: https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/run-job-variations
- 8: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow
- 9: https://docs.github.com/en/enterprise-server@3.20/actions/reference/workflows-and-actions/expressions
Scope continue-on-error to the audit step.
Keeping it at job scope makes the entire audit job non-blocking, so checkout/setup failures won’t fail the workflow. Move it to Audit production dependencies so only audit findings are ignored.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/main.yml around lines 169 - 171, Move continue-on-error:
true from the audit job configuration to the Audit production dependencies step,
leaving checkout and setup failures able to fail the job while only audit
findings are ignored.
|
This plugin has been deployed to Cloudflare R2 and is available for testing. |
## Summary Clears every finding from `pnpm run audit --prod` (which now exits 0 with zero advisories), addressing the vulnerabilities that turned the [4.36.0 release run](https://github.com/unraid/api/actions/runs/29869430785) red. Companion to #2048, which stops audit findings from blocking publishing; this one removes the findings themselves. ## Changes | Advisory | Package | Fix | |---|---|---| | [GHSA-4c8g-83qw-93j6](GHSA-4c8g-83qw-93j6) (high) | `fast-uri` (via `api > fastify`) | Bump `pnpm.overrides` pin `3.1.2 → 3.1.4` | | [GHSA-w62v-xxxg-mg59](GHSA-w62v-xxxg-mg59) (mod, XSS) | `hono` (via MCP SDK) | Add `pnpm.overrides` pin `4.12.31` | | [GHSA-xvcm-6775-5m9r](GHSA-xvcm-6775-5m9r) (high, DoS) | `immutable` (via `@graphql-codegen/client-preset`) | Move `client-preset` to `devDependencies` | | [GHSA-frvp-7c67-39w9](GHSA-frvp-7c67-39w9) (mod, path traversal) | `@hono/node-server` (via `shadcn-vue`) | Move `shadcn-vue` to `devDependencies` | ## Why the dependency moves (instead of forcing overrides) `immutable` has no patched 3.x (fix requires the 4.x major) and `@hono/node-server` requires the 2.x major — forcing either global override risks breaking the codegen/relay-compiler and MCP SDK toolchains. Both advisories reach `--prod` only because their carriers were mislabeled as runtime dependencies: - **`@graphql-codegen/client-preset`** backs `preset: 'client'` in `api/codegen.ts` (build-time codegen) and is never imported at runtime. Its eight sibling `@graphql-codegen/*` packages — and `web`'s copy of `client-preset` itself — are already `devDependencies`. This just fixes the inconsistency. - **`shadcn-vue`** is a component-scaffolding CLI referenced only in `unraid-ui`'s README and `components.json`; it is never imported by the built library. Moving them to `devDependencies` is correct hygiene and takes both advisories out of the production graph without a risky major bump. They remain installed for dev/CI, so codegen and component scaffolding are unaffected. ## Verification - `pnpm install --lockfile-only` succeeds; lockfile resolves `fast-uri@3.1.4` and `hono@4.12.31`. - `pnpm run audit --prod` → exit 0, `{info:0, low:0, moderate:0, high:0, critical:0}`. - Confirmed neither moved package is imported in runtime source (grep across `api/src` and `unraid-ui/src`).
🤖 I have created a release *beep* *boop* --- ## [4.36.1](v4.36.0...v4.36.1) (2026-07-22) ### Bug Fixes * **ci:** make dependency audit non-blocking ([#2048](#2048)) ([9db6c38](9db6c38)) * **deps:** resolve production audit advisories ([#2049](#2049)) ([e5654cc](e5654cc)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2048 +/- ##
=======================================
Coverage 52.92% 52.92%
=======================================
Files 1035 1035
Lines 72122 72122
Branches 8313 8312 -1
=======================================
+ Hits 38169 38170 +1
+ Misses 33826 33825 -1
Partials 127 127 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
The
Audit Dependenciesjob (pnpm run audit --prod) fails the entire CI - Main (API) workflow whenever a transitive production dependency has an open advisory. This turned the 4.36.0 release run red over unrelated advisories (hono,fast-uri,immutable) and required manual recovery of the production publish. This change marks the audit jobcontinue-on-errorso it can never block a release again.Why This Exists
auditis not in any publish job'sneeds, so it doesn't gate publishing through the dependency graph — it blocks by turning the aggregate workflow conclusion red, which branch protection, downstreamworkflow_rungates, and humans all key off of. This is the same class of failure already patched for PR plugin previews in #2046, whose commit note reads: "an Audit Dependencies failure made the aggregate workflow conclusion fail." Rather than papering over the three current advisories in the ignore list, this keeps the audit fully decoupled from the publish path.Resolution
Add
continue-on-error: trueto theauditjob. The audit still runs on every PR and push and still surfaces vulnerable dependencies as step annotations and logs, but a finding no longer fails the workflow.Behavior Changes
Audit Dependenciesjob now reports success (with the failing step annotated) even when advisories are present.Trade-off
The audit becomes advisory-only: a genuinely high/critical advisory will also no longer block a release. Individual advisories can still be triaged/suppressed via the existing
pnpm.auditConfig(ignoreCves/ignoreGhsas) mechanism inpackage.jsonif a hard gate on specific CVEs is ever wanted.Verification
actionlint .github/workflows/main.ymlreports only pre-existing shellcheck/type notes in untouched jobs; no new issues from this change.Summary by CodeRabbit