Include names of requested tasks in build scan notice

This should make it easier to differentiate between build scan notices for different
Gradle invocations in the same Job.

Fixes: #124
This commit is contained in:
Daz DeBoer 2021-12-31 09:35:21 -07:00
parent 13d93c1ca1
commit 42faf281e6
No known key found for this signature in database
GPG Key ID: DD6B9F0B06683D5D
5 changed files with 8 additions and 7 deletions

2
dist/main/index.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/post/index.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -237,7 +237,7 @@ export class GradleStateCache {
buildScanCapture, buildScanCapture,
`import org.gradle.util.GradleVersion `import org.gradle.util.GradleVersion
// Only run again root build. Do not run against included builds. // Only run against root build. Do not run against included builds.
def isTopLevelBuild = gradle.getParent() == null def isTopLevelBuild = gradle.getParent() == null
if (isTopLevelBuild) { if (isTopLevelBuild) {
def version = GradleVersion.current().baseVersion def version = GradleVersion.current().baseVersion
@ -272,7 +272,8 @@ def registerCallbacks(buildScanExtension, rootProjectName) {
scanFile.text = buildScan.buildScanUri scanFile.text = buildScan.buildScanUri
// Send commands directly to GitHub Actions via STDOUT. // Send commands directly to GitHub Actions via STDOUT.
def message = "Build '\${rootProjectName}'\${buildOutcome} - \${buildScan.buildScanUri}" def gradleCommand = rootProjectName + " " + gradle.startParameter.taskNames.join(" ")
def message = "Gradle build '\${gradleCommand}'\${buildOutcome} - \${buildScan.buildScanUri}"
println("::notice ::\${message}") println("::notice ::\${message}")
println("::set-output name=build-scan-url::\${buildScan.buildScanUri}") println("::set-output name=build-scan-url::\${buildScan.buildScanUri}")
} }
@ -284,7 +285,7 @@ def registerCallbacks(buildScanExtension, rootProjectName) {
fs.writeFileSync( fs.writeFileSync(
projectRootCapture, projectRootCapture,
` `
// Only run again root build. Do not run against included builds. // Only run against root build. Do not run against included builds.
def isTopLevelBuild = gradle.getParent() == null def isTopLevelBuild = gradle.getParent() == null
if (isTopLevelBuild) { if (isTopLevelBuild) {
settingsEvaluated { settings -> settingsEvaluated { settings ->