Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS SDK for JavaScript version 3 (v3) Upgrade #148

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions code-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

const core = require("@actions/core");
const github = require("@actions/github");
const aws = require("aws-sdk");
const { CloudWatchLogs } = require("@aws-sdk/client-cloudwatch-logs");
const { CodeBuild } = require("@aws-sdk/client-codebuild");
const assert = require("assert");

module.exports = {
Expand Down Expand Up @@ -36,7 +37,7 @@ function runBuild() {

async function build(sdk, params, config) {
// Start the build
const start = await sdk.codeBuild.startBuild(params).promise();
const start = await sdk.codeBuild.startBuild(params);

// Wait for the build to "complete"
return waitForBuildEndTime(sdk, start.build, config);
Expand Down Expand Up @@ -65,7 +66,7 @@ async function waitForBuildEndTime(
let errObject = false;
// Check the state
const [batch, cloudWatch = {}] = await Promise.all([
codeBuild.batchGetBuilds({ ids: [id] }).promise(),
codeBuild.batchGetBuilds({ ids: [id] }),
!hideCloudWatchLogs &&
logGroupName &&
cloudWatchLogs // only make the call if hideCloudWatchLogs is not enabled and a logGroupName exists
Expand All @@ -74,8 +75,7 @@ async function waitForBuildEndTime(
logStreamName,
startFromHead,
nextToken,
})
.promise(),
}),
]).catch((err) => {
errObject = err;
/* Returning [] here so that the assignment above
Expand Down Expand Up @@ -289,11 +289,11 @@ function inputs2Parameters(inputs) {
}

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

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

Expand Down
Loading
Loading