Skip to content

Commit b9dcef3

Browse files
authored
Merge branch 'master' into fixTypo
2 parents 82ba5c1 + 53c1509 commit b9dcef3

File tree

8 files changed

+288826
-58660
lines changed

8 files changed

+288826
-58660
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ The only required input is `project-name`.
2222
that CodeBuild requires.
2323
By default, the action uses the buildspec file location
2424
that you configured in the CodeBuild project.
25+
1. **compute-type-override** (optional) :
26+
The name of a compute type for this build that overrides the one specified
27+
in the build project.
28+
1. **environment-type-override** (optional) :
29+
A container type for this build that overrides the one specified in the
30+
build project.
31+
1. **image-override** (optional) :
32+
The name of an image for this build that overrides the one specified
33+
in the build project.
2534
1. **env-vars-for-codebuild** (optional) :
2635
A comma-separated list of the names of environment variables
2736
that the action passes from GitHub Actions to CodeBuild.
@@ -162,6 +171,9 @@ this will overwrite them.
162171
with:
163172
project-name: CodeBuildProjectName
164173
buildspec-override: path/to/buildspec.yaml
174+
compute-type-override: compute-type
175+
environment-type-override: environment-type
176+
image-override: ecr-image-uri
165177
env-vars-for-codebuild: |
166178
custom,
167179
requester,

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ inputs:
1010
buildspec-override:
1111
description: 'Buildspec Override'
1212
required: false
13+
compute-type-override:
14+
description: 'The name of a compute type for this build that overrides the one specified in the build project.'
15+
required: false
16+
environment-type-override:
17+
description: 'A container type for this build that overrides the one specified in the build project.'
18+
required: false
19+
image-override:
20+
description: 'The name of an image for this build that overrides the one specified in the build project.'
21+
required: false
1322
env-vars-for-codebuild:
1423
description: 'Comma separated list of environment variables to send to CodeBuild'
1524
required: false

code-build.js

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ function githubInputs() {
169169
const buildspecOverride =
170170
core.getInput("buildspec-override", { required: false }) || undefined;
171171

172+
const computeTypeOverride =
173+
core.getInput("compute-type-override", { required: false }) || undefined;
174+
175+
const environmentTypeOverride =
176+
core.getInput("environment-type-override", { required: false }) || undefined;
177+
const imageOverride =
178+
core.getInput("image-override", { required: false }) || undefined;
179+
172180
const envPassthrough = core
173181
.getInput("env-vars-for-codebuild", { required: false })
174182
.split(",")
@@ -181,6 +189,9 @@ function githubInputs() {
181189
repo,
182190
sourceVersion,
183191
buildspecOverride,
192+
computeTypeOverride,
193+
environmentTypeOverride,
194+
imageOverride,
184195
envPassthrough,
185196
};
186197
}
@@ -192,6 +203,9 @@ function inputs2Parameters(inputs) {
192203
repo,
193204
sourceVersion,
194205
buildspecOverride,
206+
computeTypeOverride,
207+
environmentTypeOverride,
208+
imageOverride,
195209
envPassthrough = [],
196210
} = inputs;
197211

@@ -212,6 +226,9 @@ function inputs2Parameters(inputs) {
212226
sourceTypeOverride,
213227
sourceLocationOverride,
214228
buildspecOverride,
229+
computeTypeOverride,
230+
environmentTypeOverride,
231+
imageOverride,
215232
environmentVariablesOverride,
216233
};
217234
}
@@ -234,13 +251,18 @@ function buildSdk() {
234251
}
235252

236253
function logName(Arn) {
237-
const [logGroupName, logStreamName] = Arn.split(":log-group:")
238-
.pop()
239-
.split(":log-stream:");
240-
if (logGroupName === "null" || logStreamName === "null")
241-
return {
242-
logGroupName: undefined,
243-
logStreamName: undefined,
244-
};
245-
return { logGroupName, logStreamName };
254+
const logs = {
255+
logGroupName: undefined,
256+
logStreamName: undefined,
257+
};
258+
if (Arn) {
259+
const [logGroupName, logStreamName] = Arn.split(":log-group:")
260+
.pop()
261+
.split(":log-stream:");
262+
if (logGroupName !== "null" && logStreamName !== "null") {
263+
logs.logGroupName = logGroupName;
264+
logs.logStreamName = logStreamName;
265+
}
266+
}
267+
return logs;
246268
}

dist/index.js

Lines changed: 288612 additions & 58624 deletions
Large diffs are not rendered by default.

local.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const cb = require("./code-build");
88
const assert = require("assert");
99
const yargs = require("yargs");
1010

11-
const { projectName, buildspecOverride, envPassthrough, remote } = yargs
11+
const { projectName, buildspecOverride, computeTypeOverride, environmentTypeOverride, imageOverride, envPassthrough, remote } = yargs
1212
.option("project-name", {
1313
alias: "p",
1414
describe: "AWS CodeBuild Project Name",
@@ -20,6 +20,21 @@ const { projectName, buildspecOverride, envPassthrough, remote } = yargs
2020
describe: "Path to buildspec file",
2121
type: "string",
2222
})
23+
.option("compute-type-override", {
24+
alias: "c",
25+
describe: "The name of a compute type for this build that overrides the one specified in the build project.",
26+
type: "string",
27+
})
28+
.option("environment-type-override", {
29+
alias: "et",
30+
describe: "A container type for this build that overrides the one specified in the build project.",
31+
type: "string",
32+
})
33+
.option("image-override", {
34+
alias: "i",
35+
describe: "The name of an image for this build that overrides the one specified in the build project.",
36+
type: "string",
37+
})
2338
.option("env-vars-for-codebuild", {
2439
alias: "e",
2540
describe: "List of environment variables to send to CodeBuild",
@@ -39,6 +54,9 @@ const params = cb.inputs2Parameters({
3954
...githubInfo(remote),
4055
sourceVersion: BRANCH_NAME,
4156
buildspecOverride,
57+
computeTypeOverride,
58+
environmentTypeOverride,
59+
imageOverride,
4260
envPassthrough,
4361
});
4462

package-lock.json

Lines changed: 68 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"author": "aws-crypto-tools-team@amazon.com",
1313
"license": "Apache-2.0",
1414
"dependencies": {
15-
"@actions/core": "^1.2.6",
15+
"@actions/core": "^1.9.1",
1616
"@actions/exec": "^1.0.3",
1717
"@actions/github": "^2.1.1",
1818
"aws-sdk": "^2.814.0",

0 commit comments

Comments
 (0)