@@ -15,25 +15,26 @@ class CodeBuildParser {
15
15
const buildStatus = _ . get ( event , "detail.build-status" ) ;
16
16
const project = _ . get ( event , "detail.project-name" ) ;
17
17
const logsUrl = `https://console.aws.amazon.com/cloudwatch/home?region=${ event . region } #logEventViewer:group=/aws/codebuild/${ project } ;start=PT5M` ;
18
- const projectUrl = `https://console.aws.amazon.com/codebuild/home?region=${ event . region } #/projects/${ project } /view` ;
18
+ const buildId = _ . split ( _ . get ( event , "detail.build-id" ) , ":" ) . pop ( ) ;
19
+ const buildUrl = `https://console.aws.amazon.com/codebuild/home?region=${ event . region } #/builds/${ encodeURIComponent ( project + ":" + buildId ) } /view/new` ;
19
20
const fields = [ ] ;
20
21
21
22
let color = Slack . COLORS . neutral ;
22
23
let title = project ;
23
24
if ( buildStatus === "SUCCEEDED" ) {
24
- title = `<${ projectUrl } |${ project } > has finished building` ;
25
+ title = `<${ buildUrl } |${ project } > has finished building` ;
25
26
color = Slack . COLORS . ok ;
26
27
}
27
28
else if ( buildStatus === "STOPPED" ) {
28
- title = `<${ projectUrl } |${ project } > was stopped` ;
29
+ title = `<${ buildUrl } |${ project } > was stopped` ;
29
30
color = Slack . COLORS . warning ;
30
31
}
31
32
else if ( buildStatus === "FAILED" ) {
32
- title = `<${ projectUrl } |${ project } > has failed to build` ;
33
+ title = `<${ buildUrl } |${ project } > has failed to build` ;
33
34
color = Slack . COLORS . critical ;
34
35
}
35
36
else if ( buildStatus === "IN_PROGRESS" ) {
36
- title = `<${ projectUrl } |${ project } > has started building` ;
37
+ title = `<${ buildUrl } |${ project } > has started building` ;
37
38
}
38
39
39
40
if ( buildStatus ) {
0 commit comments