mirror of
				https://github.com/gradle/gradle-build-action.git
				synced 2025-11-04 01:28:56 +08: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:
		@@ -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}\` [](\${buildScan.buildScanUri})"
 | 
			
		||||
            } else {
 | 
			
		||||
                println("::notice ::Gradle build '\${gradleCommand}' - \${buildScan.buildScanUri}")
 | 
			
		||||
                githubSummaryFile << "✅ Gradle Build \`\${gradleCommand}\` [](\${buildScan.buildScanUri})"
 | 
			
		||||
            }
 | 
			
		||||
            println("::set-output name=build-scan-url::\${buildScan.buildScanUri}")
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user