Attempt to make build-scan links open in new tab

GitHub currently strips the target="_blank" from the rendered HTML,
but we'll leave this in since it's the desired behaviour.
This commit is contained in:
daz 2024-02-11 16:13:31 -07:00
parent 109be5d55b
commit e9c65b9fc0
No known key found for this signature in database

View file

@ -123,7 +123,7 @@ function renderBuildScan(result: BuildResult): string {
function renderBuildScanBadge(outcomeText: string, outcomeColor: string, targetUrl: string): string { function renderBuildScanBadge(outcomeText: string, outcomeColor: string, targetUrl: string): string {
const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle` const badgeUrl = `https://img.shields.io/badge/Build%20Scan%C2%AE-${outcomeText}-${outcomeColor}?logo=Gradle`
const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />` const badgeHtml = `<img src="${badgeUrl}" alt="Build Scan ${outcomeText}" />`
return `<a href="${targetUrl}" rel="nofollow">${badgeHtml}</a>` return `<a href="${targetUrl}" rel="nofollow" target="_blank">${badgeHtml}</a>`
} }
function shouldGenerateJobSummary(buildResults: BuildResult[]): boolean { function shouldGenerateJobSummary(buildResults: BuildResult[]): boolean {