File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 5
5
* will be a noop when running for forked builds (i.e. PRs).
6
6
*/
7
7
8
+ import sh from 'shelljs' ;
8
9
import {
9
10
isVersionBranch ,
10
11
getConfig ,
@@ -30,21 +31,19 @@ if (isPublishBranch === false) {
30
31
process . exit ( 0 ) ;
31
32
}
32
33
33
- const { echo, set} = require ( 'shelljs' ) ;
34
-
35
34
const text = `\`${ jobName } \` failed in branch: ${ branchName } : ${ jobUrl } ` ;
36
35
const payload : { text : string ; channel ? : string } = { text } ;
37
36
const [ channelName ] = process . argv . slice ( 2 ) ;
38
37
39
- set ( '-e' ) ;
38
+ sh . set ( '-e' ) ;
40
39
41
40
// If an explicit channel has been specified, override the default
42
41
// webhook channel to the specified one.
43
42
if ( channelName !== undefined ) {
44
43
payload . channel = channelName ;
45
44
}
46
45
47
- echo ( JSON . stringify ( payload , null , 2 ) ) . exec (
46
+ sh . echo ( JSON . stringify ( payload , null , 2 ) ) . exec (
48
47
`curl -d@- -H "Content-Type: application/json" ${ webhookUrl } ` ,
49
48
) ;
50
49
console . info ( 'Notified Slack about job failure.' ) ;
You can’t perform that action at this time.
0 commit comments