mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 09:02:50 +00:00
Write build scan link to GHA job summary
The new Job Summary functionality permits better rendering of build results, including clickable build scan links
This commit is contained in:
parent
d63db6a05e
commit
646074d659
1 changed files with 4 additions and 2 deletions
|
@ -272,10 +272,12 @@ def registerCallbacks(buildScanExtension, rootProjectName) {
|
|||
buildScanPublished { buildScan ->
|
||||
// Send commands directly to GitHub Actions via STDOUT.
|
||||
def gradleCommand = rootProjectName + " " + gradle.startParameter.taskNames.join(" ")
|
||||
|
||||
def githubSummaryFile = new File(System.getenv("GITHUB_STEP_SUMMARY"))
|
||||
if (buildFailed) {
|
||||
println("::warning ::Gradle build '\${gradleCommand}' FAILED - \${buildScan.buildScanUri}")
|
||||
githubSummaryFile << "❌ Gradle Build \`\${gradleCommand}\` [![Gradle Enterprise Build Scan](https://img.shields.io/badge/Gradle%20Enterprise%20Build%20Scan%E2%84%A2-FAILED-red?logo=Gradle)](\${buildScan.buildScanUri})"
|
||||
} else {
|
||||
println("::notice ::Gradle build '\${gradleCommand}' - \${buildScan.buildScanUri}")
|
||||
githubSummaryFile << "✅ Gradle Build \`\${gradleCommand}\` [![Gradle Enterprise Build Scan](https://img.shields.io/badge/Gradle%20Enterprise%20Build%20Scan%E2%84%A2-SUCCESS-brightgreen?logo=Gradle)](\${buildScan.buildScanUri})"
|
||||
}
|
||||
println("::set-output name=build-scan-url::\${buildScan.buildScanUri}")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue