Skip to content

Commit d8df16c

Browse files
authored
Merge branch 'main' into main
2 parents 7992656 + 6e37b5c commit d8df16c

File tree

6 files changed

+38334
-48232
lines changed

6 files changed

+38334
-48232
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ Otherwise, it fails.
294294
295295
In the call to StartBuild, we pass in all
296296
`GITHUB_` [environment variables][github environment variables] in the GitHub Actions environment,
297-
plus any environment variables that you specified in the `env-passthrough` input value.
297+
plus any environment variables that you specified in the `env-vars-for-codebuild` input value.
298298
299299
By default, regardless of the project configuration in CodeBuild or GitHub Actions,
300300
we always pass the following parameters and values to CodeBuild in the StartBuild API call.

code-build.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
const core = require("@actions/core");
55
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");
78
const assert = require("assert");
89

910
module.exports = {
@@ -36,7 +37,7 @@ function runBuild() {
3637

3738
async function build(sdk, params, config) {
3839
// Start the build
39-
const start = await sdk.codeBuild.startBuild(params).promise();
40+
const start = await sdk.codeBuild.startBuild(params);
4041

4142
// Wait for the build to "complete"
4243
return waitForBuildEndTime(sdk, start.build, config);
@@ -65,7 +66,7 @@ async function waitForBuildEndTime(
6566
let errObject = false;
6667
// Check the state
6768
const [batch, cloudWatch = {}] = await Promise.all([
68-
codeBuild.batchGetBuilds({ ids: [id] }).promise(),
69+
codeBuild.batchGetBuilds({ ids: [id] }),
6970
!hideCloudWatchLogs &&
7071
logGroupName &&
7172
cloudWatchLogs // only make the call if hideCloudWatchLogs is not enabled and a logGroupName exists
@@ -74,8 +75,7 @@ async function waitForBuildEndTime(
7475
logStreamName,
7576
startFromHead,
7677
nextToken,
77-
})
78-
.promise(),
78+
}),
7979
]).catch((err) => {
8080
errObject = err;
8181
/* Returning [] here so that the assignment above
@@ -303,11 +303,11 @@ function inputs2Parameters(inputs) {
303303
}
304304

305305
function buildSdk() {
306-
const codeBuild = new aws.CodeBuild({
306+
const codeBuild = new CodeBuild({
307307
customUserAgent: "aws-actions/aws-codebuild-run-build",
308308
});
309309

310-
const cloudWatchLogs = new aws.CloudWatchLogs({
310+
const cloudWatchLogs = new CloudWatchLogs({
311311
customUserAgent: "aws-actions/aws-codebuild-run-build",
312312
});
313313

0 commit comments

Comments
 (0)