Skip to content

Commit 0b8ecfb

Browse files
authored
[ci] Fix build scan annotations on Windows (#101990) (#102028)
(cherry picked from commit f20ae0e)
1 parent 5ab8599 commit 0b8ecfb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

build-tools-internal/src/main/groovy/elasticsearch.build-scan.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,17 @@ buildScan {
142142
// Add a build annotation
143143
// See: https://buildkite.com/docs/agent/v3/cli-annotate
144144
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>"""
145-
new ProcessBuilder(
145+
def process = [
146146
'buildkite-agent',
147147
'annotate',
148148
'--context',
149149
result.failure ? 'gradle-build-scans-failed' : 'gradle-build-scans',
150150
'--append',
151151
'--style',
152-
result.failure ? 'error' : 'info',
153-
body
154-
)
155-
.start()
156-
.waitFor()
152+
result.failure ? 'error' : 'info'
153+
].execute()
154+
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
155+
process.waitFor()
157156
}
158157
}
159158
} else {

0 commit comments

Comments
 (0)