Skip to content

Commit

Permalink
Fix print audit text (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
furnivall authored Jun 21, 2023
1 parent 3d896eb commit cf2d935
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ cat <<'EOF'
EOF
}

print_borked_known_issues() {
cat <<'EOF'
You have an invalid yarn-audit-known-issues file.
The command to suppress known vulnerabilities has changed.
Please now use the following:
`yarn npm audit --recursive --environment production --json > yarn-audit-known-issues`
EOF
}

# Function to check for unneeded suppressions
check_for_unneeded_suppressions() {
while IFS= read -r line; do
Expand Down Expand Up @@ -101,7 +115,7 @@ if [ ! -f yarn-audit-known-issues ]; then
else
# Test for old format of yarn-audit-known-issues
if ! jq 'has("actions", "advisories", "metadata")' yarn-audit-known-issues | grep -q true; then
echo "You have an invalid `yarn-audit-known-issues` file. \nThe command to suppress known vulnerabilities has changed. Please now use the following: \n`yarn npm audit --recursive --environment production --json > yarn-audit-known-issues`"
print_borked_known_issues
exit 1
fi

Expand Down

0 comments on commit cf2d935

Please sign in to comment.