mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 16:20:59 -05:00
Include build scan link in failure notice
This commit is contained in:
parent
947a893558
commit
39db90e99b
3 changed files with 13 additions and 6 deletions
2
dist/main/index.js
vendored
2
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/main/index.js.map
vendored
2
dist/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
15
src/main.ts
15
src/main.ts
|
@ -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))
|
||||||
|
|
Loading…
Reference in a new issue