File tree 4 files changed +11
-4
lines changed
4 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ The only required input is `project-name`.
72
72
1 . ** disable-source-override** (optional) :
73
73
Set to ` true ` if you want to disable providing ` sourceVersion ` ,
74
74
` sourceTypeOverride ` and ` sourceLocationOverride ` to CodeBuild.
75
+ 1 . ** source-version-override** (optional) :
76
+ The source version that overrides the ` sourceVersion ` provided to Codebuild.
75
77
1 . ** env-vars-for-codebuild** (optional) :
76
78
A comma-separated list of the names of environment variables
77
79
that the action passes from GitHub Actions to CodeBuild.
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ inputs:
34
34
disable-source-override :
35
35
description : ' Set to `true` if you want do disable source repo override'
36
36
required : false
37
+ source-version-override :
38
+ description : ' The source version that overrides the sourceVersion provided to Codebuild.'
39
+ required : false
37
40
hide-cloudwatch-logs :
38
41
description : ' Set to `true` to prevent the CloudWatch logs from streaming the output to GitHub'
39
42
required : false
Original file line number Diff line number Diff line change @@ -176,9 +176,10 @@ function githubInputs() {
176
176
// the GITHUB_SHA value is NOT the correct value.
177
177
// See: https://github.com/aws-actions/aws-codebuild-run-build/issues/36
178
178
const sourceVersion =
179
- process . env [ `GITHUB_EVENT_NAME` ] === "pull_request"
179
+ core . getInput ( "source-version-override" , { required : false } ) ||
180
+ ( process . env [ `GITHUB_EVENT_NAME` ] === "pull_request"
180
181
? ( ( ( payload || { } ) . pull_request || { } ) . head || { } ) . sha
181
- : process . env [ `GITHUB_SHA` ] ;
182
+ : process . env [ `GITHUB_SHA` ] ) ;
182
183
183
184
assert ( sourceVersion , "No source version could be evaluated." ) ;
184
185
const buildspecOverride =
Original file line number Diff line number Diff line change @@ -182,9 +182,10 @@ function githubInputs() {
182
182
// the GITHUB_SHA value is NOT the correct value.
183
183
// See: https://github.com/aws-actions/aws-codebuild-run-build/issues/36
184
184
const sourceVersion =
185
- process.env[`GITHUB_EVENT_NAME`] === "pull_request"
185
+ core.getInput("source-version-override", { required: false }) ||
186
+ (process.env[`GITHUB_EVENT_NAME`] === "pull_request"
186
187
? (((payload || {}).pull_request || {}).head || {}).sha
187
- : process.env[`GITHUB_SHA`];
188
+ : process.env[`GITHUB_SHA`]) ;
188
189
189
190
assert(sourceVersion, "No source version could be evaluated.");
190
191
const buildspecOverride =
You can’t perform that action at this time.
0 commit comments