Skip to content

Commit 7d2c159

Browse files
a-orenclaude
andcommitted
feat(report): add remediation and recommendation details to pipeline summary
The Tekton task console output now surfaces trusted-content remediations and recommendations that were previously only available in the JSON report. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 156bb77 commit 7d2c159

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

docker-image/scripts/trustify-da.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,34 @@ for provider in $providers; do
103103
printf " High : %s \n" "$(jq -r --arg provider "$provider" --arg source "$source" '.providers[$provider].sources[$source].summary.high' <<< $report)"
104104
printf " Medium : %s \n" "$(jq -r --arg provider "$provider" --arg source "$source" '.providers[$provider].sources[$source].summary.medium' <<< $report)"
105105
printf " Low : %s \n" "$(jq -r --arg provider "$provider" --arg source "$source" '.providers[$provider].sources[$source].summary.low' <<< $report)"
106+
remediations_count=$(jq -r --arg provider "$provider" --arg source "$source" '.providers[$provider].sources[$source].summary.remediations' <<< $report)
107+
printf " Remediations : %s \n" "$remediations_count"
108+
if [ "$remediations_count" -gt 0 ] 2>/dev/null; then
109+
jq -r --arg provider "$provider" --arg source "$source" '
110+
[.providers[$provider].sources[$source].dependencies[] |
111+
. as $dep |
112+
[(.issues // [])[] | select(.remediation.trustedContent.ref != null) |
113+
{ref: $dep.ref, tc: .remediation.trustedContent.ref, cves: ((.cves // [.id]) | join(", "))}
114+
] + [(.transitive // [])[] | . as $t |
115+
(.issues // [])[] | select(.remediation.trustedContent.ref != null) |
116+
{ref: $t.ref, tc: .remediation.trustedContent.ref, cves: ((.cves // [.id]) | join(", "))}
117+
]
118+
] | flatten | unique_by(.ref + .tc) | .[] |
119+
" \(.ref)\n → \(.tc)\n CVEs: \(.cves)"
120+
' <<< "$report"
121+
fi
122+
done
123+
124+
rec_sources=$(jq -r --arg provider "$provider" '.providers[$provider].recommendations // {} | keys[]' <<< "$report" 2>/dev/null)
125+
for rec_source in $rec_sources; do
126+
rec_total=$(jq -r --arg provider "$provider" --arg rs "$rec_source" '.providers[$provider].recommendations[$rs].summary.total // 0' <<< "$report")
127+
printf " Recommendations (%s): %s\n" "$rec_source" "$rec_total"
128+
if [ "$rec_total" -gt 0 ] 2>/dev/null; then
129+
jq -r --arg provider "$provider" --arg rs "$rec_source" '
130+
.providers[$provider].recommendations[$rs].dependencies[]? |
131+
" \(.ref)\n → \(.recommendation)"
132+
' <<< "$report"
133+
fi
106134
done
107135
fi
108136
done

0 commit comments

Comments
 (0)