Skip to content

Commit

Permalink
[ci] Fix build scan annotations on Windows (#101990) (#102027)
Browse files Browse the repository at this point in the history
(cherry picked from commit f20ae0e)
  • Loading branch information
brianseeders authored Nov 10, 2023
1 parent df73595 commit 6f9ff58
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,17 @@ buildScan {
// Add a build annotation
// See: https://buildkite.com/docs/agent/v3/cli-annotate
def body = """<div class="mb3"><span class="p1 border rounded">${System.getenv('BUILDKITE_LABEL')}</span> :gradle: ${result.failure ? 'failed' : 'successful'} build: <a href="${scan.buildScanUri}"><code>gradle ${gradle.startParameter.taskNames.join(' ')}</code></a></div>"""
new ProcessBuilder(
def process = [
'buildkite-agent',
'annotate',
'--context',
result.failure ? 'gradle-build-scans-failed' : 'gradle-build-scans',
'--append',
'--style',
result.failure ? 'error' : 'info',
body
)
.start()
.waitFor()
result.failure ? 'error' : 'info'
].execute()
process.withWriter { it.write(body) } // passing the body in as an argument has issues on Windows, so let's use stdin of the process instead
process.waitFor()
}
}
} else {
Expand Down

0 comments on commit 6f9ff58

Please sign in to comment.