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 \ 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": {