Skip to content

Commit

Permalink
[ci] Fix build scan annotations on Windows (#101990) (#102028)
Browse files Browse the repository at this point in the history
(cherry picked from commit f20ae0e)
brianseeders authored Nov 10, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5ab8599 commit 0b8ecfb
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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 {

0 comments on commit 0b8ecfb

Please sign in to comment.