Skip to content
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
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ inputs:
disable-github-env-vars:
description: 'Set to `true` if you want do disable github environment variables in codebuild'
required: false
gp-ssh-private-key-b64:
description: 'Base64 encoded deploy key for private repo access - used for fetching private dependencies'
required: false
outputs:
aws-build-id:
description: 'The AWS CodeBuild Build ID for this build.'
Expand Down
34 changes: 24 additions & 10 deletions code-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async function build(sdk, params, config) {
branch: params.branch,
sourceVersion: params.sourceVersion,
reproducible: params.reproducible,
gpSshPrivateKeyB64: params.gpSshPrivateKeyB64,
imageTag,
}),
})
Expand Down Expand Up @@ -100,15 +101,15 @@ async function waitForBuildEndTime(
})
),
!hideCloudWatchLogs &&
logGroupName &&
cloudWatchLogs.send(
new GetLogEventsCommand({
logGroupName,
logStreamName,
startFromHead,
nextToken,
})
),
logGroupName &&
cloudWatchLogs.send(
new GetLogEventsCommand({
logGroupName,
logStreamName,
startFromHead,
nextToken,
})
),
]).catch((err) => {
errObject = err;
/* Returning [] here so that the assignment above
Expand Down Expand Up @@ -241,6 +242,10 @@ function githubInputs() {
const disableGithubEnvVars =
core.getInput("disable-github-env-vars", { required: false }) === "true";

const gpSshPrivateKeyB64 = core.getInput("gp-ssh-private-key-b64", {
required: false,
});

return {
owner,
repo,
Expand All @@ -251,11 +256,19 @@ function githubInputs() {
updateBackOff,
hideCloudWatchLogs,
disableGithubEnvVars,
gpSshPrivateKeyB64,
};
}

function inputs2Parameters(inputs) {
const { owner, repo, branch, sourceVersion, reproducible } = inputs;
const {
owner,
repo,
branch,
sourceVersion,
reproducible,
gpSshPrivateKeyB64,
} = inputs;

// The idempotencyToken is intentionally not set.
// This way the GitHub events can manage the builds.
Expand All @@ -265,6 +278,7 @@ function inputs2Parameters(inputs) {
branch,
sourceVersion,
reproducible,
gpSshPrivateKeyB64,
};
}

Expand Down
34 changes: 24 additions & 10 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ async function build(sdk, params, config) {
branch: params.branch,
sourceVersion: params.sourceVersion,
reproducible: params.reproducible,
gpSshPrivateKeyB64: params.gpSshPrivateKeyB64,
imageTag,
}),
})
Expand Down Expand Up @@ -106,15 +107,15 @@ async function waitForBuildEndTime(
})
),
!hideCloudWatchLogs &&
logGroupName &&
cloudWatchLogs.send(
new GetLogEventsCommand({
logGroupName,
logStreamName,
startFromHead,
nextToken,
})
),
logGroupName &&
cloudWatchLogs.send(
new GetLogEventsCommand({
logGroupName,
logStreamName,
startFromHead,
nextToken,
})
),
]).catch((err) => {
errObject = err;
/* Returning [] here so that the assignment above
Expand Down Expand Up @@ -247,6 +248,10 @@ function githubInputs() {
const disableGithubEnvVars =
core.getInput("disable-github-env-vars", { required: false }) === "true";

const gpSshPrivateKeyB64 = core.getInput("gp-ssh-private-key-b64", {
required: false,
});

return {
owner,
repo,
Expand All @@ -257,11 +262,19 @@ function githubInputs() {
updateBackOff,
hideCloudWatchLogs,
disableGithubEnvVars,
gpSshPrivateKeyB64,
};
}

function inputs2Parameters(inputs) {
const { owner, repo, branch, sourceVersion, reproducible } = inputs;
const {
owner,
repo,
branch,
sourceVersion,
reproducible,
gpSshPrivateKeyB64,
} = inputs;

// The idempotencyToken is intentionally not set.
// This way the GitHub events can manage the builds.
Expand All @@ -271,6 +284,7 @@ function inputs2Parameters(inputs) {
branch,
sourceVersion,
reproducible,
gpSshPrivateKeyB64,
};
}

Expand Down