Include build scan link in failure notice

This commit is contained in:
Daz DeBoer 2021-10-21 12:02:52 -06:00
parent 947a893558
commit 39db90e99b
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
3 changed files with 13 additions and 6 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

View file

@ -28,13 +28,20 @@ export async function run(): Promise<void> {
if (result.buildScanUrl) { if (result.buildScanUrl) {
core.setOutput('build-scan-url', result.buildScanUrl) core.setOutput('build-scan-url', result.buildScanUrl)
// TODO Include context about the invocation (eg step name) in this message
// Unfortunately it doesn't seem possible to access the current step name here
core.notice(`Gradle build scan: ${result.buildScanUrl}`)
} }
if (result.status !== 0) { if (result.status !== 0) {
core.setFailed(`Gradle process exited with status ${result.status}`) if (result.buildScanUrl) {
core.setFailed(`Gradle build failed: ${result.buildScanUrl}`)
} else {
core.setFailed(
`Gradle build failed: process exited with status ${result.status}`
)
}
} else {
if (result.buildScanUrl) {
core.notice(`Gradle build succeeded: ${result.buildScanUrl}`)
}
} }
} catch (error) { } catch (error) {
core.setFailed(String(error)) core.setFailed(String(error))