Unverified Commit 39db90e9 authored by Daz DeBoer's avatar Daz DeBoer
Browse files

Include build scan link in failure notice

parent 947a8935
Loading
Loading
Loading
Loading
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+11 −4
Changes for src/main.ts: 11 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -28,13 +28,20 @@ export async function run(): Promise<void> {

        if (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) {
            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) {
        core.setFailed(String(error))