From b98210c48019aba9dd7d1d153a075b999eb2cef3 Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Mon, 3 Feb 2025 16:23:04 -0500 Subject: [PATCH] Include the GHSA number when sorting npm excludes This allows for a more consistent sorting when running multiple times. --- lib/tasks/test_security_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/test_security_helper.rb b/lib/tasks/test_security_helper.rb index 34c2902d369..63a519c0ad1 100644 --- a/lib/tasks/test_security_helper.rb +++ b/lib/tasks/test_security_helper.rb @@ -166,7 +166,7 @@ def self.rebuild_yarn_audit_pending end values - .sort_by { |v| YARN_AUDIT_SEVERITY_SORT.index(v[1]) || Float::MAX } + .sort_by { |v| [YARN_AUDIT_SEVERITY_SORT.index(v[1]) || Float::MAX, v[2]] } # Sort by severity, then by the GHSA number, for consistency .tableize(:header => false) .lines .map { |l| l.sub(/^ /, "# ") }