3
3
4
4
const core = require ( "@actions/core" ) ;
5
5
const github = require ( "@actions/github" ) ;
6
- const aws = require ( "aws-sdk" ) ;
6
+ const { CloudWatchLogs } = require ( "@aws-sdk/client-cloudwatch-logs" ) ;
7
+ const { CodeBuild } = require ( "@aws-sdk/client-codebuild" ) ;
7
8
const assert = require ( "assert" ) ;
8
9
9
10
module . exports = {
@@ -36,7 +37,7 @@ function runBuild() {
36
37
37
38
async function build ( sdk , params , config ) {
38
39
// Start the build
39
- const start = await sdk . codeBuild . startBuild ( params ) . promise ( ) ;
40
+ const start = await sdk . codeBuild . startBuild ( params ) ;
40
41
41
42
// Wait for the build to "complete"
42
43
return waitForBuildEndTime ( sdk , start . build , config ) ;
@@ -65,7 +66,7 @@ async function waitForBuildEndTime(
65
66
let errObject = false ;
66
67
// Check the state
67
68
const [ batch , cloudWatch = { } ] = await Promise . all ( [
68
- codeBuild . batchGetBuilds ( { ids : [ id ] } ) . promise ( ) ,
69
+ codeBuild . batchGetBuilds ( { ids : [ id ] } ) ,
69
70
! hideCloudWatchLogs &&
70
71
logGroupName &&
71
72
cloudWatchLogs // only make the call if hideCloudWatchLogs is not enabled and a logGroupName exists
@@ -74,8 +75,7 @@ async function waitForBuildEndTime(
74
75
logStreamName,
75
76
startFromHead,
76
77
nextToken,
77
- } )
78
- . promise ( ) ,
78
+ } ) ,
79
79
] ) . catch ( ( err ) => {
80
80
errObject = err ;
81
81
/* Returning [] here so that the assignment above
@@ -303,11 +303,11 @@ function inputs2Parameters(inputs) {
303
303
}
304
304
305
305
function buildSdk ( ) {
306
- const codeBuild = new aws . CodeBuild ( {
306
+ const codeBuild = new CodeBuild ( {
307
307
customUserAgent : "aws-actions/aws-codebuild-run-build" ,
308
308
} ) ;
309
309
310
- const cloudWatchLogs = new aws . CloudWatchLogs ( {
310
+ const cloudWatchLogs = new CloudWatchLogs ( {
311
311
customUserAgent : "aws-actions/aws-codebuild-run-build" ,
312
312
} ) ;
313
313
0 commit comments