fix(js-dependency-audit): drop invalid --groups flag for yarn-classic#171
Merged
Conversation
`yarn audit --json --groups dependencies,devDependencies` doesn't work for yarn v1: `--groups` is a space-separated multi-arg flag, so the comma-joined form is parsed as a single literal group name that doesn't exist, and the audit returns 0 advisories with `totalDependencies: 0`. Dropping the flag uses yarn's default groups (`devDependencies,dependencies,optionalDependencies`), which matches the original intent (audit prod + dev dependencies) and aligns with what npm/pnpm/yarn-berry already do. Verified on giantswarm/happa (yarn-classic): - Before (broken): 0 advisories, 0 deps - After (default): 342 advisories, 3194 deps Surfaced via happa#4746, whose audit comment showed `0 added · 0 removed · 0 total` and no current-vulnerabilities details block.
gusevda
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
yarn audit --json --groups dependencies,devDependenciesdoesn't work for yarn v1:--groupsis a space-separated multi-arg flag, so the comma-joined form is parsed as a single literal group name that doesn't exist, and the audit returns 0 advisories withtotalDependencies: 0.Dropping the flag uses yarn's default groups (
devDependencies,dependencies,optionalDependencies), matching the original intent (audit prod + dev dependencies) and aligning with whatnpm,pnpm, andyarn-berryalready do here.How it surfaced
giantswarm/happa#4746is a Renovate PR upgradingmermaidto fix several CVEs. The audit comment showed:…with no "Full current vulnerability list" details block. Both audit runs (head and base) produced empty findings, so the delta was 0/0/0 and the renderer correctly skipped the empty list.
Verification on happa (yarn-classic)
yarn audit --json --groups dependencies,devDependencies(before)yarn audit --json --groups dependencies devDependencies(space, valid)yarn audit --json(default, this PR)Default groups also include
optionalDependencies, which is consistent with whatnpm auditreports.Test plan
giantswarm/happa#4746(or any yarn-classic caller) and confirm the comment now reports a non-zero current total and renders the details block.