Skip to content

Commit 4beb27b

Browse files
authored
ci: show path value in audit-dependencies script [skip ci] (#13314)
Improve audit-dependencies script to show the vulnerable package path: ```diff { "package": "form-data", "vulnerable": "<2.5.4", - "fixed_in": ">=2.5.4" + "fixed_in": ">=2.5.4", + "findings": [ + { + "version": "2.5.2", + "paths": [ + "packages/storage-gcs > @google-cloud/storage@7.14.0 > retry-request@7.0.2 > @types/request@2.48.12 > form-data@2.5.2" + ] + } + ] } ] ```
1 parent c5c8c13 commit 4beb27b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/audit-dependencies.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ echo "${audit_json}" | jq --arg severity "${severity}" '
1313
{
1414
package: .value.module_name,
1515
vulnerable: .value.vulnerable_versions,
16-
fixed_in: .value.patched_versions
16+
fixed_in: .value.patched_versions,
17+
findings: .value.findings
1718
}
1819
)
1920
' >$output_file
@@ -23,7 +24,11 @@ audit_length=$(jq 'length' $output_file)
2324
if [[ "${audit_length}" -gt "0" ]]; then
2425
echo "Actionable vulnerabilities found in the following packages:"
2526
jq -r '.[] | "\u001b[1m\(.package)\u001b[0m vulnerable in \u001b[31m\(.vulnerable)\u001b[0m fixed in \u001b[32m\(.fixed_in)\u001b[0m"' $output_file | while read -r line; do echo -e "$line"; done
27+
echo ""
2628
echo "Output written to ${output_file}"
29+
cat $output_file
30+
echo ""
31+
echo "This script can be rerun with: './.github/workflows/audit-dependencies.sh $severity'"
2732
exit 1
2833
else
2934
echo "No actionable vulnerabilities"

.github/workflows/audit-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
"type": "section",
4747
"text": {
4848
"type": "mrkdwn",
49-
"text": "🚨 Actionable vulnerabilities found: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Details>"
49+
"text": "🚨 Actionable vulnerabilities found: <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Script Run Details>"
5050
}
5151
},
5252
]

0 commit comments

Comments
 (0)