From b1862c5da6d72e11209a817ccecaa47678ce32c1 Mon Sep 17 00:00:00 2001 From: Brice TEXIER Date: Fri, 6 Mar 2026 15:03:54 +0100 Subject: [PATCH 1/2] Show fail level --- rdjson_formatter/rdjson_formatter.rb | 2 +- script.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rdjson_formatter/rdjson_formatter.rb b/rdjson_formatter/rdjson_formatter.rb index 7980046..9f077b3 100755 --- a/rdjson_formatter/rdjson_formatter.rb +++ b/rdjson_formatter/rdjson_formatter.rb @@ -44,7 +44,7 @@ # Create message with fix guidance patched = advisory['recommendation'] || 'No fix available' - message = "Title: #{title}\nSolution: #{patched}" + message = "[#{severity}] #{title}\nSolution: #{patched}" # Find package line in yarn.lock # yarn.lock has package entries like: "package-name@^1.0.0:" diff --git a/script.sh b/script.sh index 7c065bc..f5da0b7 100755 --- a/script.sh +++ b/script.sh @@ -20,7 +20,7 @@ fi export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" -echo '::group:: Running yarn audit with reviewdog 🐶 ...' +echo "::group:: Running yarn audit with reviewdog 🐶 (fail on ${INPUT_FAIL_LEVEL}) ..." # shellcheck disable=SC2086 yarn audit --json \ From 970f9708d20168f8779d49aaa98a4579d0b9f114 Mon Sep 17 00:00:00 2001 From: Brice TEXIER Date: Fri, 6 Mar 2026 15:05:53 +0100 Subject: [PATCH 2/2] Fix test --- test/rdjson_formatter/testdata/result.ok | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/rdjson_formatter/testdata/result.ok b/test/rdjson_formatter/testdata/result.ok index ae89886..5171d40 100644 --- a/test/rdjson_formatter/testdata/result.ok +++ b/test/rdjson_formatter/testdata/result.ok @@ -6,7 +6,7 @@ "severity": "ERROR", "diagnostics": [ { - "message": "Title: Prototype Pollution in minimist\nSolution: Upgrade to version 0.2.1 or later", + "message": "[moderate] Prototype Pollution in minimist\nSolution: Upgrade to version 0.2.1 or later", "location": { "path": "yarn.lock", "range": { @@ -23,7 +23,7 @@ } }, { - "message": "Title: Prototype Pollution in minimist\nSolution: Upgrade to version 0.2.4 or later", + "message": "[critical] Prototype Pollution in minimist\nSolution: Upgrade to version 0.2.4 or later", "location": { "path": "yarn.lock", "range": {