Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
taoyong-ty authored Jan 31, 2024
2 parents 7992656 + 6e37b5c commit d8df16c
Show file tree
Hide file tree
Showing 6 changed files with 38,334 additions and 48,232 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ Otherwise, it fails.
In the call to StartBuild, we pass in all
`GITHUB_` [environment variables][github environment variables] in the GitHub Actions environment,
plus any environment variables that you specified in the `env-passthrough` input value.
plus any environment variables that you specified in the `env-vars-for-codebuild` input value.
By default, regardless of the project configuration in CodeBuild or GitHub Actions,
we always pass the following parameters and values to CodeBuild in the StartBuild API call.
Expand Down
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 @@ -303,11 +303,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

0 comments on commit d8df16c

Please sign in to comment.